A couple of places in sk_newlistener were using AF_INET6 even with NO_IPV6.
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Tue, 13 Sep 2005 19:54:01 +0000 (19:54 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Tue, 13 Sep 2005 19:54:01 +0000 (19:54 +0000)
Correct them.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6305 cda61777-01e9-0310-a592-d414129be87e

unix/uxnet.c

index 8865d9d..3cf1b5f 100644 (file)
@@ -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);