dovecot-1.1: [::] listens only for IPv6 addresses now. This gets...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 15:17:07 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/da971cec0395
changeset: 7274:da971cec0395
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 15:18:31 2008 +0200
description:
[::] listens only for IPv6 addresses now. This gets rid of IPv4-mapped IPv6
addresses. Use "listen = *, [::]" for listening both.

diffstat:

2 files changed, 4 insertions(+), 3 deletions(-)
dovecot-example.conf |    2 +-
src/lib/network.c    |    5 +++--

diffs (29 lines):

diff -r 1d87dc550378 -r da971cec0395 dovecot-example.conf
--- a/dovecot-example.conf	Thu Feb 21 14:46:01 2008 +0200
+++ b/dovecot-example.conf	Thu Feb 21 15:18:31 2008 +0200
@@ -25,7 +25,7 @@
 # A space separated list of IP or host addresses where to listen in for
 # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
 # interfaces, but may also listen in all IPv4 interfaces depending on the
-# operating system.
+# operating system. Use "*, [::]" for listening both IPv4 and IPv6.
 #
 # If you want to specify ports for each service, you will need to configure
 # these settings inside the protocol imap/pop3 { ... } section, so you can
diff -r 1d87dc550378 -r da971cec0395 src/lib/network.c
--- a/src/lib/network.c	Thu Feb 21 14:46:01 2008 +0200
+++ b/src/lib/network.c	Thu Feb 21 15:18:31 2008 +0200
@@ -318,10 +318,11 @@ 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 */
+	/* If using IPv6, bind only to IPv6 if possible. This avoids
+	   ambiguities with IPv4-mapped IPv6 addresses. */
 #ifdef IPV6_V6ONLY
 	if (so.sin.sin_family == AF_INET6) {
-		opt = 0;
+		opt = 1;
 		setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt));
 	}
 #endif


More information about the dovecot-cvs mailing list