diff options
author | Timo Sirainen <cras@irssi.org> | 2002-01-29 21:26:41 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-01-29 21:26:41 +0000 |
commit | f2a4a9766869fbaae52c1da7d7721ebe93588f6a (patch) | |
tree | 0b898c07172bf9ac4cae6909f08ee9e6e605818d /src/core | |
parent | 3801628b44e310f65fe04f9e428570d385000753 (diff) | |
download | irssi-f2a4a9766869fbaae52c1da7d7721ebe93588f6a.zip |
net_gethostbyname() fix for ipv6.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2357 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/network.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/network.c b/src/core/network.c index 17f91d90..8792b9e8 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -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; } |