1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

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.
This commit is contained in:
LemonBoy 2016-01-27 16:16:27 +01:00
parent f31b2026b4
commit 0cc8276e89

View File

@ -390,6 +390,7 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
memset(&hints, 0, sizeof(struct addrinfo)); memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG;
/* save error to host_error for later use */ /* save error to host_error for later use */
ret = getaddrinfo(addr, NULL, &hints, &ailist); ret = getaddrinfo(addr, NULL, &hints, &ailist);