Hi Arthur,

On 17/04/2019 07:54, Alan Bateman wrote:
On 16/04/2019 22:34, Arthur Eubanks wrote:
Hi,

Copied from the bug https://bugs.openjdk.java.net/browse/JDK-8222562:
Some of the networking code tries to support dual socket support. However, it doesn't work with IPv6 only systems.

setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, 0) returns a failure with errno EAFNOSUPPORT, and then the networking code bails. It should not bail when it sees that trying to set IPV6_V6ONLY fails.

webrev: http://cr.openjdk.java.net/~aeubanks/ipv6setsockopt/webrev.00/index.html

One thing to note is that similar code exists in the Windows part of the networking code (e.g. java.base/windows/native/libnet/PlainSocketImpl.c), but I don't know how to test Windows code so I'm only touching the Unix-specific part.

This code is compiled on other Unix-like ports too so I think we should at least try to see if they also return EAFNOSUPPORT when configured for IPv6-only.

Also should we have an ipv4_available() utility similar
to ipv6_available() and check that before making the decision not
to bail on EAFNOSUPPORT? Or would that be a chicken and egg problem?

best regards,

-- daniel


-Alan

Reply via email to