# HG changeset patch # User Timo Sirainen # Date 1203599907 -7200 # Node ID 1919baa9e6367362ef97e429f110e3995e45733e # Parent fa2b3c9b7d0829c408cd09334cb1979bad4399e6 [::] listens only for IPv6 addresses now. This gets rid of IPv4-mapped IPv6 addresses. Use "listen = *, [::]" for listening both. 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 @@ 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