put back the correct logic, as the change dated July 11th 2006 added bad
authorDaniel Stenberg <daniel@haxx.se>
Thu, 27 Jul 2006 22:28:53 +0000 (22:28 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 27 Jul 2006 22:28:53 +0000 (22:28 +0000)
behaviour and a socket leak

lib/hostip6.c

index 7ea632a..c8bbdb5 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -244,7 +244,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
 
   /* see if we have an IPv6 stack */
   s = socket(PF_INET6, SOCK_DGRAM, 0);
-  if (s != CURL_SOCKET_BAD) {
+  if (s == CURL_SOCKET_BAD) {
     /* Some non-IPv6 stacks have been found to make very slow name resolves
      * when PF_UNSPEC is used, so thus we switch to a mere PF_INET lookup if
      * the stack seems to be a non-ipv6 one. */