From: Timo Sirainen Date: Mon, 13 Dec 2010 13:40:27 +0000 (+0000) Subject: net_listen(): If IPv6 isn't supported, don't fallback to IPv4 if my_ip is given. X-Git-Tag: 2.0.9~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2e77b012bcb13baba1ab8e5604f2d096a4f374a;p=thirdparty%2Fdovecot%2Fcore.git net_listen(): If IPv6 isn't supported, don't fallback to IPv4 if my_ip is given. --- diff --git a/src/lib/network.c b/src/lib/network.c index 8f010b9f0b..f9ad33d893 100644 --- a/src/lib/network.c +++ b/src/lib/network.c @@ -371,7 +371,8 @@ int net_listen(const struct ip_addr *my_ip, unsigned int *port, int backlog) /* create the socket */ fd = socket(so.sin.sin_family, SOCK_STREAM, 0); #ifdef HAVE_IPV6 - if (fd == -1 && (errno == EINVAL || errno == EAFNOSUPPORT)) { + if (fd == -1 && my_ip == NULL && + (errno == EINVAL || errno == EAFNOSUPPORT)) { /* IPv6 is not supported by OS */ so.sin.sin_family = AF_INET; so.sin.sin_addr.s_addr = INADDR_ANY;