-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
libcurl can't connect to ipv4 numerical IP address in NAT64 environment #863
Comments
Sorry but I don't understand. You provide a URL using an IPv4 numerical address and it doesn't work? libcurl won't use any resolver for that but will try to connect to that IP address on the default port. If you enable
Then you shouldn't specify the target address using an IPv4 numerical as that will make libcurl try IPv4 on it. How would libcurl know how to trancode that address over to your preferred IPv6 alternative? |
We met the same problem on iOS too since the Apple requires all iOS apps to support IPv6 only networks. The Apple seggests following solution:
Example url: |
like thease codes:
` |
And dns cache feature of libcurl may have a problem: |
That is a totally separate subject. This issue is about IPv4 addresses in a nat64 apple environment. |
Hm ok. That's a bit unfortunate but should be possible quite easily by just removing the shortcuts we have that avoid name resolves for pure numerical addresses (when built for platforms that need this approach). I would prefer someone who can actually try that out to suggest a patch. |
Yes, Apple's suggestion does work for me (but with a minor issue that the sin6_port is always zero). Here is my quick & dirty patch. |
Thanks!
|
Fixed
Fixed
It must be removed to get synthesized IPv6 address. |
- 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
@bagder can i know when to release a new CURL version? coocs2d-x uses CURL, the games developed using cocos2d-x were rejected by apple about this issue. |
See our release calendar, HTML version. July 21 is the plan. |
thanks @bagder |
my test environment:
a mac mini share NAT64 wifi,
an iphone connect this wifi,
in this iphone use libcurl to connect ipv4 server url , such like "http://192.168.1.200/"
it can‘t connect to server.
the reason may be:
libcurl try parse ip addr directly. result of resolver only have one sockaddr:
AF_INET: 192.168.1.200
in my test code, the result 'addrinfo' of os 'getaddrino' api have two sockaddr:
AF_INET6: 0064:ff9b:0000:0000:0000:0000:192.168.1.200
AF_INET: 192.168.1.200
connect AF_INET6 addr is ok , and connect AF_INET addr is error in this environment.
curl/libcurl version 7.41
The text was updated successfully, but these errors were encountered: