X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxnet.c;h=3cf1b5f0fde4db4cfb4bc20cabcb2fc048c99ad7;hb=49d2cf19accb059b3b68d1fc2b78e606a578c3e8;hp=5d4ace44cb241044ce3dca8584f44d3d16ae1a0d;hpb=4cb79827c67c3817ed2a33ca95c2c4da909aafad;p=PuTTY.git diff --git a/unix/uxnet.c b/unix/uxnet.c index 5d4ace44..3cf1b5f0 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -23,7 +23,7 @@ #include "tree234.h" /* Solaris needs for SIOCATMARK. */ -#ifdef HAVE_SYS_SOCKIO_H +#ifndef SIOCATMARK #include #endif @@ -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);