It turns out these patches only apply to a modified kernel which has patches to turn off IPv4. This specific patch doesn't make sense to submit if the kernel patches are not upstream.
Maybe the entire call to setsockopt(IPV6_V6ONLY, 0) could be skipped if IPv4 is disabled. I'll look into Daniel's suggestion of a ipv4_available() utility. On Wed, Apr 17, 2019 at 7:01 AM Chris Hegarty <chris.hega...@oracle.com> wrote: > Arthur, > > 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. > > I assume that you are on Linux, right? If so, have you compiled the > Kernel without IPv4 support? How have you configured your system without > IPv4 support? > > I'm curious as I would like to try something similar, as well as on > other platforms, macOS, etc. > > -Chris. >