mirror of
https://github.com/irssi/irssi.git
synced 2024-09-08 04:26:01 -04: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) {
|
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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user