diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-01-27 16:16:27 +0100 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-01-27 16:16:27 +0100 |
commit | 0cc8276e896441a186a8080f127e35d60112d758 (patch) | |
tree | c4830b9d57b9a2009452586a48252b4171625ec5 | |
parent | f31b2026b4732e57f88af14796ac0dea4b2d0131 (diff) | |
download | irssi-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.c | 1 |
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); |