From d12dcd1d6dfbcc57926f5caae0a88cc5cc2be330 Mon Sep 17 00:00:00 2001 From: thilo Date: Tue, 23 Jun 2009 00:19:08 +0000 Subject: minor cleanup git-svn-id: svn://svn.icculus.org/quake3/trunk@1576 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/net_ip.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'code/qcommon') diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c index 06bed4b..725ca35 100644 --- a/code/qcommon/net_ip.c +++ b/code/qcommon/net_ip.c @@ -284,8 +284,6 @@ static qboolean Sys_StringToSockaddr(const char *s, struct sockaddr *sadr, int s hintsp = &hints; hintsp->ai_family = family; hintsp->ai_socktype = SOCK_DGRAM; - // FIXME: we should set "->ai_flags" to AI_PASSIVE if we intend - // to use this structure for a bind() - instead of a sendto() retval = getaddrinfo(s, NULL, hintsp, &res); @@ -294,18 +292,20 @@ static qboolean Sys_StringToSockaddr(const char *s, struct sockaddr *sadr, int s if(family == AF_UNSPEC) { // Decide here and now which protocol family to use - if((net_enabled->integer & NET_ENABLEV6) && (net_enabled->integer & NET_PRIOV6)) - search = SearchAddrInfo(res, AF_INET6); + if((net_enabled->integer & NET_PRIOV6) + { + if(net_enabled->integer & NET_ENABLEV6) + search = SearchAddrInfo(res, AF_INET6); + + if(!search && (net_enabled->integer & NET_ENABLEV4)) + search = SearchAddrInfo(res, AF_INET); + } else - search = SearchAddrInfo(res, AF_INET); - - if(!search) { - if((net_enabled->integer & NET_ENABLEV6) && - (net_enabled->integer & NET_PRIOV6) && - (net_enabled->integer & NET_ENABLEV4)) + if(net_enabled->integer & NET_ENABLEV4) search = SearchAddrInfo(res, AF_INET); - else if(net_enabled->integer & NET_ENABLEV6) + + if(!search && (net_enabled->integer & NET_ENABLEV6)) search = SearchAddrInfo(res, AF_INET6); } } -- cgit v1.2.3