summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2016-01-27 16:16:27 +0100
committerLemonBoy <thatlemon@gmail.com>2016-01-27 16:16:27 +0100
commit0cc8276e896441a186a8080f127e35d60112d758 (patch)
treec4830b9d57b9a2009452586a48252b4171625ec5
parentf31b2026b4732e57f88af14796ac0dea4b2d0131 (diff)
downloadirssi-0cc8276e896441a186a8080f127e35d60112d758.zip
Add AI_ADDRCONFIG to the getaddrinfo hints.
A first step to untangle the ipv4 vs ipv6 mess. At the time of writing Linux, OpenBSD and FreeBSD all support the AI_ADDRCONFIG flag.
-rw-r--r--src/core/network.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/network.c b/src/core/network.c
index 28189661..d777bdcc 100644
--- a/src/core/network.c
+++ b/src/core/network.c
@@ -390,6 +390,7 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_ADDRCONFIG;
/* save error to host_error for later use */
ret = getaddrinfo(addr, NULL, &hints, &ailist);