1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

net_gethostbyname() fix for ipv6.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2357 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-29 21:26:41 +00:00 committed by cras
parent 3801628b44
commit f2a4a97668

View File

@ -407,12 +407,14 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
while (ai != NULL && count < 2) { while (ai != NULL && count < 2) {
so = (union sockaddr_union *) ai->ai_addr; so = (union sockaddr_union *) ai->ai_addr;
if (ai->ai_family == AF_INET6 && ip6->family == 0) { if (so != NULL) {
sin_get_ip(so, ip6); if (ai->ai_family == AF_INET6 && ip6->family == 0) {
count++; sin_get_ip(so, ip6);
} else if (ai->ai_family == AF_INET && ip4->family == 0) { count++;
sin_get_ip(so, ip4); } else if (ai->ai_family == AF_INET && ip4->family == 0) {
count++; sin_get_ip(so, ip4);
count++;
}
} }
ai = ai->ai_next; ai = ai->ai_next;
} }