From 400f45c79387ac1a1988b81a3097b81e046b7de3 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Wed, 5 Feb 2014 22:53:47 +0100 Subject: [PATCH] Do not use AI_ADDRCONFIG on Windows It was not available on my MinGW crosscompiler, and it may be harmful: https://code.google.com/p/chromium/issues/detail?id=5234 Also, remove old conflicting WINVER in osflags. It is set in src/windows.h now. --- src/common.c | 5 +++++ src/osflags | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common.c b/src/common.c index 19fdb95..6a40924 100644 --- a/src/common.c +++ b/src/common.c @@ -125,7 +125,12 @@ get_addr(char *host, int port, int addr_family, int flags, struct sockaddr_stora memset(&hints, 0, sizeof(hints)); hints.ai_family = addr_family; +#ifdef WINDOWS32 + /* AI_ADDRCONFIG misbehaves on windows */ + hints.ai_flags = flags; +#else hints.ai_flags = AI_ADDRCONFIG | flags; +#endif hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; diff --git a/src/osflags b/src/osflags index 2d8a03b..4641b39 100755 --- a/src/osflags +++ b/src/osflags @@ -26,9 +26,6 @@ link) ;; cflags) case $1 in - windows32) - echo '-DWINVER=0x0501'; - ;; BeOS) echo '-Dsocklen_t=int'; ;;