aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/net_chan.c
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-04-09 14:37:42 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-04-09 14:37:42 +0000
commitd07f81b00b41cf18a47fc70029bc1db85bc8c1a4 (patch)
tree5a1ece65070c5cf46298506a24c8f6d7e74d42e7 /code/qcommon/net_chan.c
parent549f5614f649aade0fb1dc6869c8ba192ea0173d (diff)
downloadioquake3-aero-d07f81b00b41cf18a47fc70029bc1db85bc8c1a4.tar.gz
ioquake3-aero-d07f81b00b41cf18a47fc70029bc1db85bc8c1a4.zip
Add Multicast capabilities for LAN server scanning.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1305 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/net_chan.c')
-rw-r--r--code/qcommon/net_chan.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/code/qcommon/net_chan.c b/code/qcommon/net_chan.c
index ac7b30b..e4b1739 100644
--- a/code/qcommon/net_chan.c
+++ b/code/qcommon/net_chan.c
@@ -686,10 +686,9 @@ qboolean NET_StringToAdr( const char *s, netadr_t *a, netadrtype_t family ) {
return qtrue;
}
- // look for a port number
Q_strncpyz( base, s, sizeof( base ) );
- if(*base == '[')
+ if(*base == '[' || Q_CountChar(base, ':') > 1)
{
// This is an ipv6 address, handle it specially.
search = strchr(base, ']');
@@ -702,10 +701,14 @@ qboolean NET_StringToAdr( const char *s, netadr_t *a, netadrtype_t family ) {
port = search + 1;
}
- search = base + 1;
+ if(*base == '[')
+ search = base + 1;
+ else
+ search = base;
}
else
{
+ // look for a port number
port = strchr( base, ':' );
if ( port ) {