From 64810700e25fa7bcb6377d25a3953d6fc529779f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 25 May 2000 17:12:44 +0000 Subject: [PATCH] Didn't compile with IPv6 support. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@242 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/network.c b/src/core/network.c index 55431971..ced2fb2e 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -53,7 +53,7 @@ inline void sin_set_ip(union sockaddr_union *so, const IPADDR *ip) if (ip == NULL) { #ifdef HAVE_IPV6 so->sin6.sin6_family = AF_INET6; - so->sin6.sin6_addr.s_addr = in6addr_any; + so->sin6.sin6_addr = in6addr_any; #else so->sin.sin_family = AF_INET; so->sin.sin_addr.s_addr = INADDR_ANY; @@ -361,13 +361,15 @@ int net_gethostbyaddr(IPADDR *ip, char **name) g_return_val_if_fail(ip != NULL, -1); g_return_val_if_fail(name != NULL, -1); + net_ip2host(ip, ipname); + *name = NULL; #ifdef HAVE_IPV6 memset(&req, 0, sizeof(struct addrinfo)); req.ai_socktype = SOCK_STREAM; /* save error to host_error for later use */ - host_error = getaddrinfo(addr, NULL, &req, &ai); + host_error = getaddrinfo(ipname, NULL, &req, &ai); if (host_error != 0) return host_error; @@ -378,8 +380,6 @@ int net_gethostbyaddr(IPADDR *ip, char **name) freeaddrinfo(ai); return 1; #else - net_ip2host(ip, ipname); - hp = gethostbyaddr(ipname, strlen(ipname), AF_INET); if (hp == NULL) return -1;