]> sjero.net Git - wget/commitdiff
[svn] Stop using AI_ADDRCONFIG.
authorhniksic <devnull@localhost>
Fri, 17 Jun 2005 16:48:29 +0000 (09:48 -0700)
committerhniksic <devnull@localhost>
Fri, 17 Jun 2005 16:48:29 +0000 (09:48 -0700)
src/ChangeLog
src/connect.c
src/connect.h
src/host.c

index 18dfa9b5dd61aea961767431e52df39b51081700..a7c739cac3874df358f9df4170fffd5846db0275 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-17  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * connect.c (socket_has_inet6): Removed.
+
+       * host.c (lookup_host): Don't use the AI_ADDRCONFIG getaddrinfo
+       hint.
+
 2005-06-16  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * init.c (cmd_lockable_boolean): Improve the error message so it
index 24dd1faae943341ae3534042585798a8e2c9bc1c..16b6de6c3412c0ea8abbd7e6b145d35e3174cfef 100644 (file)
@@ -608,37 +608,6 @@ retryable_socket_connect_error (int err)
   return 1;
 }
 
-#ifdef ENABLE_IPV6
-# ifndef HAVE_GETADDRINFO_AI_ADDRCONFIG
-
-/* Return non-zero if the INET6 socket family is supported on the
-   system.
-
-   This doesn't guarantee that we're able to connect to IPv6 hosts,
-   but it's better than nothing.  It is only used on systems where
-   getaddrinfo doesn't support AI_ADDRCONFIG.  (See lookup_host.)  */
-
-int
-socket_has_inet6 (void)
-{
-  static int supported = -1;
-  if (supported == -1)
-    {
-      int sock = socket (AF_INET6, SOCK_STREAM, 0);
-      if (sock < 0)
-       supported = 0;
-      else
-       {
-         fd_close (sock);
-         supported = 1;
-       }
-    }
-  return supported;
-}
-
-# endif/* not HAVE_GETADDRINFO_AI_ADDRCONFIG */
-#endif /* ENABLE_IPV6 */
-
 /* Wait for a single descriptor to become available, timing out after
    MAXTIME seconds.  Returns 1 if FD is available, 0 for timeout and
    -1 for error.  The argument WAIT_FOR can be a combination of
index 85242260317aec6bae299b864f3c3b8e710e7a8f..4dbebad7ba65bb365a1bf186a1ea02ac8c180a8f 100644 (file)
@@ -59,7 +59,6 @@ enum {
 };
 int select_fd PARAMS ((int, double, int));
 int test_socket_open PARAMS ((int));
-int socket_has_inet6 PARAMS ((void));
 
 typedef int (*fd_reader_t) PARAMS ((int, char *, int, void *));
 typedef int (*fd_writer_t) PARAMS ((int, char *, int, void *));
index f1fb64e7d3f7d040371711f15ca2f0942d9be873..af736dabea53893e99f63cc4722020584222d8a9 100644 (file)
@@ -767,17 +767,11 @@ lookup_host (const char *host, int flags)
     else if (opt.ipv6_only)
       hints.ai_family = AF_INET6;
     else
-      {
+      /* We used to specify AI_ADDRCONFIG here, but removed it because
+        it fails in on systems with IPv6 loopbacks, it loses on AIX
+        5.1, and isn't really needed as we sort the addresses).  */
        hints.ai_family = AF_UNSPEC;
-#ifdef AI_ADDRCONFIG
-       hints.ai_flags |= AI_ADDRCONFIG;
-#else
-       /* On systems without AI_ADDRCONFIG, emulate it by manually
-          checking whether the system supports IPv6 sockets.  */
-       if (!socket_has_inet6 ())
-         hints.ai_family = AF_INET;
-#endif
-      }
+
     if (flags & LH_BIND)
       hints.ai_flags |= AI_PASSIVE;