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
cf-socket: turn off IPV6_V6ONLY on Windows if it is supported #10975
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! |
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