]> granicus.if.org Git - curl/commitdiff
resolve: enable protocol family logic for synthesized IPv6
authorLuo Jinghua <sunmoon1997@gmail.com>
Tue, 7 Jun 2016 23:23:54 +0000 (07:23 +0800)
committerJay Satiro <raysatiro@yahoo.com>
Wed, 8 Jun 2016 02:23:24 +0000 (22:23 -0400)
- Enable protocol family logic for IPv6 resolves even when support
for synthesized addresses is enabled.

This is a follow up to the parent commit that added support for
synthesized IPv6 addresses from IPv4 on iOS/OS X. The protocol family
logic needed for IPv6 was inadvertently excluded if support for
synthesized addresses was enabled.

Bug: https://github.com/curl/curl/issues/863
Ref: https://github.com/curl/curl/pull/866
Ref: https://github.com/curl/curl/pull/867

lib/asyn-thread.c

index 0ca2603349d5567123434b83db7dc2d972ec25f9..967859a07f3309c8f4c372f404a04bf7f7503040 100644 (file)
@@ -616,7 +616,10 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
   if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
     /* This is an IPv6 address literal */
     return Curl_ip2addr(AF_INET6, &in6, hostname, port);
+#endif /* CURLRES_IPV6 */
+#endif /* !USE_RESOLVE_ON_IPS */
 
+#ifdef CURLRES_IPV6
   /*
    * Check if a limited name resolve has been requested.
    */
@@ -635,9 +638,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
   if((pf != PF_INET) && !Curl_ipv6works())
     /* The stack seems to be a non-IPv6 one */
     pf = PF_INET;
-
 #endif /* CURLRES_IPV6 */
-#endif /* USE_RESOLVE_ON_IPS */
 
   memset(&hints, 0, sizeof(hints));
   hints.ai_family = pf;