From d07f81b00b41cf18a47fc70029bc1db85bc8c1a4 Mon Sep 17 00:00:00 2001 From: thilo Date: Wed, 9 Apr 2008 14:37:42 +0000 Subject: Add Multicast capabilities for LAN server scanning. git-svn-id: svn://svn.icculus.org/quake3/trunk@1305 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/net_chan.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'code/qcommon/net_chan.c') 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 ) { -- cgit v1.2.3