From 40040af101f11f2526d6caa1e56c8a2ea7bbbd33 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 13 Sep 2005 19:54:01 +0000 Subject: [PATCH] A couple of places in sk_newlistener were using AF_INET6 even with NO_IPV6. Correct them. git-svn-id: svn://svn.tartarus.org/sgt/putty@6305 cda61777-01e9-0310-a592-d414129be87e --- unix/uxnet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unix/uxnet.c b/unix/uxnet.c index 8865d9d5..3cf1b5f0 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -691,7 +691,10 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i * into local reality. */ address_family = (address_family == ADDRTYPE_IPV4 ? AF_INET : - address_family == ADDRTYPE_IPV6 ? AF_INET6 : AF_UNSPEC); +#ifndef NO_IPV6 + address_family == ADDRTYPE_IPV6 ? AF_INET6 : +#endif + AF_UNSPEC); #ifndef NO_IPV6 /* Let's default to IPv6. @@ -707,11 +710,13 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i */ s = socket(address_family, SOCK_STREAM, 0); +#ifndef NO_IPV6 /* If the host doesn't support IPv6 try fallback to IPv4. */ if (s < 0 && address_family == AF_INET6) { address_family = AF_INET; s = socket(address_family, SOCK_STREAM, 0); } +#endif if (s < 0) { ret->error = strerror(errno); -- 2.11.0