-
-
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
curl --ipv6
on macOS will connect to an ipv4 address
#13112
Comments
This is an IPv6 address, a so called IPv4-mapped address. curl asks to resolve the name as IPv6-only and it gets an IPv6 address from the OS that it uses, and it works. I don't see what else curl can do here... |
is it though? it's IPv4 mapped. it's still IPv4 it's just making it look like IPv6 for compatibility |
It is an IPv4 address mapped into an IPv6 address. IPv4 is 32 bit only, it couldn't have room for the extra 16 bits of ffff in the beginning. So it is clearly partly IPv6. |
how about this diff --git a/docs/cmdline-opts/ipv6.md b/docs/cmdline-opts/ipv6.md
index fbacbec..d4e9de1 100644
--- a/docs/cmdline-opts/ipv6.md
+++ b/docs/cmdline-opts/ipv6.md
@@ -22,3 +22,6 @@ Example:
This option tells curl to use IPv6 addresses only when resolving hostnames,
and not for example try IPv4.
+
+Note your resolver may respond to an IPv6-only resolve request by returning
+IPv6 addresses that contain "mapped" IPv4 addresses for compatibility purposes. |
Yes, sensible. Maybe even highlight that macOS is known to do this. |
Reported-by: Josh Soref Assisted-by: Jay Satiro Fixes #13112
I did this
I expected the following
When I try to connect via ipv4 to an ipv6 only host, I get an error:
I'd expect to get an error when trying to connect via
--ipv6
to an ipv4 only host.(I'm trying to use
--ipv6
to validate a remote server's support for ipv6, not my local kernel's ability to lie and do evil dual stack fallback stuff.)curl/libcurl version
curl 8.4.0 (x86_64-apple-darwin23.0) libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1
Release-Date: 2023-10-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets
operating system
Darwin jsoref-mbp.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: