From 63946ff7efd783d17e8b8874e5379bd2dbbd044c Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sat, 10 Oct 2015 23:09:48 +0300 Subject: [PATCH] sock: set AI_ADDRCONFIG only if defined AI_ADDRCONFIG is undefined on some systems. --- src/sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sock.c b/src/sock.c index 0824d31..ade501a 100644 --- a/src/sock.c +++ b/src/sock.c @@ -86,7 +86,9 @@ sock_t sock_connect(const char * const host, const unsigned int port) memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; +#ifdef AI_ADDRCONFIG hints.ai_flags = AI_ADDRCONFIG; +#endif /* AI_ADDRCONFIG */ hints.ai_protocol = IPPROTO_TCP; hints.ai_socktype = SOCK_STREAM;