mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -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:
parent
3801628b44
commit
f2a4a97668
@ -407,12 +407,14 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
|
||||
while (ai != NULL && count < 2) {
|
||||
so = (union sockaddr_union *) ai->ai_addr;
|
||||
|
||||
if (ai->ai_family == AF_INET6 && ip6->family == 0) {
|
||||
sin_get_ip(so, ip6);
|
||||
count++;
|
||||
} else if (ai->ai_family == AF_INET && ip4->family == 0) {
|
||||
sin_get_ip(so, ip4);
|
||||
count++;
|
||||
if (so != NULL) {
|
||||
if (ai->ai_family == AF_INET6 && ip6->family == 0) {
|
||||
sin_get_ip(so, ip6);
|
||||
count++;
|
||||
} else if (ai->ai_family == AF_INET && ip4->family == 0) {
|
||||
sin_get_ip(so, ip4);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
ai = ai->ai_next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user