aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
Diffstat (limited to 'code')
-rw-r--r--code/qcommon/net_ip.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c
index a2960c4..cb2094e 100644
--- a/code/qcommon/net_ip.c
+++ b/code/qcommon/net_ip.c
@@ -266,12 +266,20 @@ Sys_StringToSockaddr
static qboolean Sys_StringToSockaddr(const char *s, struct sockaddr *sadr, int sadr_len, sa_family_t family)
{
struct addrinfo hints, *res = NULL, *search;
+ struct addrinfo *hintsp;
int retval;
memset(sadr, '\0', sizeof(*sadr));
memset(&hints, '\0', sizeof(hints));
-
- hints.ai_family = family;
+
+ // workaround for buggy MacOSX getaddrinfo implementation that doesn't handle AF_UNSPEC in hints correctly.
+ if(family == AF_UNSPEC)
+ hintsp = NULL;
+ else
+ {
+ hintsp = &hints;
+ hintsp->ai_family = family;
+ }
retval = getaddrinfo(s, NULL, &hints, &res);