]> sjero.net Git - wget/commitdiff
[svn] Specify AI_ADDRCONFIG only when the address family is not explicitly
authorhniksic <devnull@localhost>
Sat, 15 Nov 2003 02:18:41 +0000 (18:18 -0800)
committerhniksic <devnull@localhost>
Sat, 15 Nov 2003 02:18:41 +0000 (18:18 -0800)
requested.

src/ChangeLog
src/host.c

index 3cfc1b45bf19f75a65c0eef307f3f9407140a81e..d58e371e2d64ba4b7f49eb4960b3067443eef6e3 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-15  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * host.c (lookup_host): Use AI_ADDRCONFIG only if the family is
+       unspecified.  This ensures that specifying `--no-inet4' on systems
+       where IPv6 resolves, but doesn't work behaves the same regardless
+       of the availability of AI_ADDRCONFIG.
+
 2003-11-15  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * host.c: Don't refer to the now-removed function
index d5475bed0f2a875f833b4c68360e12728c51c966..b77c1170bd0835e48caf46d58951c1d5818c8379 100644 (file)
@@ -575,16 +575,19 @@ lookup_host (const char *host, int flags)
 
     xzero (hints);
     hints.ai_socktype = SOCK_STREAM;
-    hints.ai_family = AF_UNSPEC;
     if (opt.ipv4_only && !opt.ipv6_only)
       hints.ai_family = AF_INET;
     else if (opt.ipv6_only && !opt.ipv4_only)
       hints.ai_family = AF_INET6;
-
+    else
+      {
+       hints.ai_family = AF_UNSPEC;
 #ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG
-    /* Use AI_ADDRCONFIG where available.  See init.c:defaults().  */
-    hints.ai_flags |= AI_ADDRCONFIG;
+       /* Use AI_ADDRCONFIG if available and if specific family isn't
+          explicitly requested.  See init.c:defaults().  */
+       hints.ai_flags |= AI_ADDRCONFIG;
 #endif
+      }
     if (flags & LH_BIND)
       hints.ai_flags |= AI_PASSIVE;