diff options
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/net_ip.c | 22 |
1 files changed, 11 insertions, 11 deletions
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); } } |