cf-socket: turn off IPV6_V6ONLY on Windows if it is supported#10975
cf-socket: turn off IPV6_V6ONLY on Windows if it is supported#10975lifenjoiner wants to merge 2 commits intocurl:masterfrom
Conversation
IPV6_V6ONLY refs: https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses https://github.com/golang/go/blob/master/src/net/ipsock_posix.go https://en.wikipedia.org/wiki/Unix-like off: https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables https://man.netbsd.org/inet6.4 https://man.freebsd.org/cgi/man.cgi?query=inet6 https://github.com/apple-oss-distributions/xnu/blob/main/bsd/man/man4/inet6.4 on: https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options acts like off, but returns 1 and dummy setting: https://man.dragonflybsd.org/?command=inet6 https://man.dragonflybsd.org/?command=ip6 unsupported and read-only returns 1: https://man.openbsd.org/inet6.4 default value refs: https://datatracker.ietf.org/doc/html/rfc3493#section-5.3 https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables
|
Quoting section 5.3 of RFC 3493:
Which sounds like the opposite to the reason for this PR? |
|
The whole note in section 5.3 of RFC 3493:
That is confusing. I guess it means in separate translator "boxes" by the SIIT (rfc2765) abstract section:
Some facts on IPv4-mapped IPv6 addresses support:
Edit: I had a golang compiled proxy for Firefox. Golang runtime has the capability by default. |
|
The problem is Windows doesn't follow the RFC to set |
|
Does it really need a separate function? #if defined(IPV6_V6ONLY) && defined(WIN32)
/* Allow IPv4 with AF_INET6 sockets on Windows. Other OSes allow this by default. */
{
int on = 0;
setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on));
}
#endif |
Not really. A function is for other place to reuse it. And, if not, the line is longer than 79 chars with |
The real reason is, I saw "we write C89 code", just recalled. Line 50 in 6b1e4dc |
|
Thanks! |
IPV6_V6ONLY refs: https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses https://github.com/golang/go/blob/master/src/net/ipsock_posix.go https://en.wikipedia.org/wiki/Unix-like https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options default value refs: https://datatracker.ietf.org/doc/html/rfc3493#section-5.3 https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables Closes curl#10975
The macro is present in all supported Windows toolchains. It's present in mingw-w64 v3+, and in MS SDK 6.0A+ (possibly earlier). Note: It may not be supported by `USE_LWIPSOCK`. Follow-up to a28f5f6 curl#18010 Follow-up to ca3f6de curl#10975
The macro is present in all supported Windows toolchains. It's present in mingw-w64 v3+, and in MS SDK 6.0A+ (maybe earlier). Also: - restrict this logic to `USE_WINSOCK` (was: `_WIN32`), to exclude alternate socket libraries (i.e. lwIP). lwIP supports `IPV6_V6ONLY` since its 2.0.0 (2016-11-10) release and it's disabled by default, unlike in Winsock. Ref: lwip-tcpip/lwip@e65202f - delete interim setter function/dummy macro `set_ipv6_v6only()`. Follow-up to a28f5f6 #18010 Follow-up to ca3f6de #10975 Closes #19769
It makes support for IPv4-mapped IPv6 addresses.
IPV6_V6ONLY refs:
https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses
https://github.com/golang/go/blob/master/src/net/ipsock_posix.go
https://en.wikipedia.org/wiki/Unix-like
off:
https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables
https://man.netbsd.org/inet6.4
https://man.freebsd.org/cgi/man.cgi?query=inet6
https://github.com/apple-oss-distributions/xnu/blob/main/bsd/man/man4/inet6.4
on:
https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options
acts like off, but returns 1 and dummy setting:
https://man.dragonflybsd.org/?command=inet6
https://man.dragonflybsd.org/?command=ip6
unsupported and read-only returns 1:
https://man.openbsd.org/inet6.4
default value refs:
https://datatracker.ietf.org/doc/html/rfc3493#section-5.3
https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables