dovecot: [::] listens only for IPv6 addresses now. This gets rid...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Feb 21 15:17:03 EET 2008
details: http://hg.dovecot.org/dovecot/rev/1919baa9e636
changeset: 7271:1919baa9e636
user: Timo Sirainen <tss at iki.fi>
date: Thu Feb 21 15:18:27 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 fa2b3c9b7d08 -r 1919baa9e636 dovecot-example.conf
--- a/dovecot-example.conf Thu Feb 21 14:45:58 2008 +0200
+++ b/dovecot-example.conf Thu Feb 21 15:18:27 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 fa2b3c9b7d08 -r 1919baa9e636 src/lib/network.c
--- a/src/lib/network.c Thu Feb 21 14:45:58 2008 +0200
+++ b/src/lib/network.c Thu Feb 21 15:18:27 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