From c690c99dd434934a09f38b57d7598c8ecd1231eb Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 1 Dec 2010 12:08:43 +0100 Subject: Make windows inet_gethost work for ipv6 --- erts/etc/common/inet_gethost.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'erts/etc/common') diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c index e095836258..ab24ac1048 100644 --- a/erts/etc/common/inet_gethost.c +++ b/erts/etc/common/inet_gethost.c @@ -65,10 +65,8 @@ #include /* These are not used even if they would exist which they should not */ -#undef HAVE_GETADDRINFO #undef HAVE_GETIPNODEBYNAME #undef HAVE_GETHOSTBYNAME2 -#undef HAVE_GETNAMEINFO #undef HAVE_GETIPNODEBYADDR #else /* Unix */ @@ -1762,7 +1760,11 @@ static int worker_loop(void) struct addrinfo hints; memset(&hints, 0, sizeof(hints)); +#ifdef __WIN32__ + hints.ai_flags = (AI_CANONNAME); +#else hints.ai_flags = (AI_CANONNAME|AI_V4MAPPED|AI_ADDRCONFIG); +#endif hints.ai_socktype = SOCK_STREAM; hints.ai_family = AF_INET6; DEBUGF(5, ("Starting getaddrinfo(%s, ...)", data)); -- cgit v1.2.3