]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
net_gethostbyname() was broken with IPv6 enabled (wasn't really used with
authorTimo Sirainen <tss@iki.fi>
Sun, 13 Jun 2004 23:37:40 +0000 (02:37 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 13 Jun 2004 23:37:40 +0000 (02:37 +0300)
Dovecot anyway). Some other cleanups.

--HG--
branch : HEAD

src/lib/network.c
src/lib/network.h

index fbb8d3ba1ff35b93893f66e3bffdf8c0115c617b..91270e63f4ed0ff758c3b3ebf152102be8ba41c3 100644 (file)
@@ -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;
 
index 50635a716f89f5d3bf75daf33db5048f36affe4b..e4612eb7ee97fc3004c194601284e378029d0e88 100644 (file)
@@ -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);