Package: dovecot
Severity: normal
Tags: patch upstream

With this patch the program will always bind on both IPv4 and IPv6
addresses (when binding to [::] has been requested) no matter how the
system is configured.
This allows using a single daemon for IPv4 and IPv6 on modern Linux and
BSD systems.
Please forward the patch upstream.

--- ./lib/network.c.orig        2005-05-11 20:48:20.991276814 +0200
+++ ./lib/network.c     2005-05-11 20:53:28.608398088 +0200
@@ -270,6 +270,15 @@ int net_listen(const struct ip_addr *my_
        setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
        setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt));
 
+       /* if using IPv6, bind both on the IPv4 and IPv6 addresses */
+#ifdef IPV6_V6ONLY
+       if (so.sin.sin_family == AF_INET6) {
+               int opt0 = 0;
+
+               setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt0, sizeof(opt0));
+       }
+#endif
+
        /* specify the address/port we want to listen in */
        ret = bind(fd, &so.sa, SIZEOF_SOCKADDR(so));
        if (ret >= 0) {

----- End forwarded message -----

-- 
ciao,
Marco


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to