diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c index 06bed4b2..725ca350 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); - else - search = SearchAddrInfo(res, AF_INET); - - if(!search) + if((net_enabled->integer & NET_PRIOV6) { - if((net_enabled->integer & NET_ENABLEV6) && - (net_enabled->integer & NET_PRIOV6) && - (net_enabled->integer & NET_ENABLEV4)) + if(net_enabled->integer & NET_ENABLEV6) + search = SearchAddrInfo(res, AF_INET6); + + if(!search && (net_enabled->integer & NET_ENABLEV4)) search = SearchAddrInfo(res, AF_INET); - else if(net_enabled->integer & NET_ENABLEV6) + } + else + { + if(net_enabled->integer & NET_ENABLEV4) + search = SearchAddrInfo(res, AF_INET); + + if(!search && (net_enabled->integer & NET_ENABLEV6)) search = SearchAddrInfo(res, AF_INET6); } }