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:
parent
3801628b44
commit
f2a4a97668
@ -407,6 +407,7 @@ 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 (so != NULL) {
|
||||||
if (ai->ai_family == AF_INET6 && ip6->family == 0) {
|
if (ai->ai_family == AF_INET6 && ip6->family == 0) {
|
||||||
sin_get_ip(so, ip6);
|
sin_get_ip(so, ip6);
|
||||||
count++;
|
count++;
|
||||||
@ -414,6 +415,7 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
|
|||||||
sin_get_ip(so, ip4);
|
sin_get_ip(so, ip4);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ai = ai->ai_next;
|
ai = ai->ai_next;
|
||||||
}
|
}
|
||||||
freeaddrinfo(origai);
|
freeaddrinfo(origai);
|
||||||
|
Loading…
Reference in New Issue
Block a user