Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve: really suppport IPv6 only networks on iOS/OS X #867

Closed
wants to merge 1 commit into from

Conversation

zeeker999
Copy link
Contributor

Further fix for PR #886
Fixes #883

@jay
Copy link
Member

jay commented Jun 8, 2016

This changes the behavior, you will have to guard that area with ipv6,

diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 0ca2603..0504fb0 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -608,45 +608,47 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdat
 #ifndef USE_RESOLVE_ON_IPS
   /* First check if this is an IPv4 address string */
   if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
     /* This is a dotted IP address 123.123.123.123-style */
     return Curl_ip2addr(AF_INET, &in, hostname, port);

 #ifdef CURLRES_IPV6
   /* check if this is an IPv6 address string */
   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.
    */
   switch(conn->ip_version) {
   case CURL_IPRESOLVE_V4:
     pf = PF_INET;
     break;
   case CURL_IPRESOLVE_V6:
     pf = PF_INET6;
     break;
   default:
     pf = PF_UNSPEC;
     break;
   }

   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;
   hints.ai_socktype = conn->socktype;

   snprintf(sbuf, sizeof(sbuf), "%d", port);

   /* fire up a new resolver thread! */
   if(init_resolve_thread(conn, hostname, port, &hints)) {
     *waitp = 1; /* expect asynchronous response */
     return NULL;
   }

@zeeker999
Copy link
Contributor Author

This changes the behavior, you will have to guard that area with ipv6,

Fixed, and squashed to previous commit as 97fe665.

jay pushed a commit that referenced this pull request Jun 8, 2016
- 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: #863
Ref: #866
Ref: #867
@jay
Copy link
Member

jay commented Jun 8, 2016

Thanks, landed in 608d161.

@jay jay closed this Jun 8, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Units used in the progress meter are not clear
2 participants