minor cleanup

This commit is contained in:
Thilo Schulz 2009-06-23 00:19:08 +00:00
parent 0d6741fb23
commit fb5f2a40ad

View file

@ -284,8 +284,6 @@ static qboolean Sys_StringToSockaddr(const char *s, struct sockaddr *sadr, int s
hintsp = &hints; hintsp = &hints;
hintsp->ai_family = family; hintsp->ai_family = family;
hintsp->ai_socktype = SOCK_DGRAM; 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); 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) if(family == AF_UNSPEC)
{ {
// Decide here and now which protocol family to use // Decide here and now which protocol family to use
if((net_enabled->integer & NET_ENABLEV6) && (net_enabled->integer & NET_PRIOV6)) if((net_enabled->integer & NET_PRIOV6)
search = SearchAddrInfo(res, AF_INET6);
else
search = SearchAddrInfo(res, AF_INET);
if(!search)
{ {
if((net_enabled->integer & NET_ENABLEV6) && if(net_enabled->integer & NET_ENABLEV6)
(net_enabled->integer & NET_PRIOV6) && search = SearchAddrInfo(res, AF_INET6);
(net_enabled->integer & NET_ENABLEV4))
if(!search && (net_enabled->integer & NET_ENABLEV4))
search = SearchAddrInfo(res, AF_INET); 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); search = SearchAddrInfo(res, AF_INET6);
} }
} }