From: Timo Sirainen Date: Sun, 13 Jun 2004 23:37:40 +0000 (+0300) Subject: net_gethostbyname() was broken with IPv6 enabled (wasn't really used with X-Git-Tag: 1.1.alpha1~3993 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68dd1a402de86167473d01a046402696de2fda60;p=thirdparty%2Fdovecot%2Fcore.git net_gethostbyname() was broken with IPv6 enabled (wasn't really used with Dovecot anyway). Some other cleanups. --HG-- branch : HEAD --- diff --git a/src/lib/network.c b/src/lib/network.c index fbb8d3ba1f..91270e63f4 100644 --- a/src/lib/network.c +++ b/src/lib/network.c @@ -442,7 +442,7 @@ int net_gethostbyname(const char *addr, struct ip_addr **ips, int *ips_count) for (ai = origai; ai != NULL; ai = ai->ai_next, count++) { so = (union sockaddr_union *) ai->ai_addr; - sin_get_ip(so, ips[count]); + sin_get_ip(so, &(*ips)[count]); } freeaddrinfo(origai); #else @@ -607,7 +607,7 @@ int net_hosterror_notfound(int error) } /* Get name of TCP service */ -char *net_getservbyport(unsigned short port) +const char *net_getservbyport(unsigned short port) { struct servent *entry; diff --git a/src/lib/network.h b/src/lib/network.h index 50635a716f..e4612eb7ee 100644 --- a/src/lib/network.h +++ b/src/lib/network.h @@ -49,9 +49,6 @@ int net_connect_ip(const struct ip_addr *ip, unsigned int port, int net_connect_unix(const char *path); /* Disconnect socket */ void net_disconnect(int fd); -/* Try to let the other side close the connection, if it still isn't - disconnected after certain amount of time, close it ourself */ -void net_disconnect_later(int fd); /* Set socket blocking/nonblocking */ void net_set_nonblock(int fd, int nonblock); @@ -101,7 +98,7 @@ int net_addr2ip(const char *addr, struct ip_addr *ip); int net_geterror(int fd); /* Get name of TCP service */ -char *net_getservbyport(unsigned short port); +const char *net_getservbyport(unsigned short port); int is_ipv4_address(const char *addr); int is_ipv6_address(const char *addr);