diff -r 8684e6479b20 -r 40fdbdd92617 src/java.base/unix/native/libnio/ch/Net.c --- a/src/java.base/unix/native/libnio/ch/Net.c Thu Apr 25 14:36:51 2019 +0100 +++ b/src/java.base/unix/native/libnio/ch/Net.c Fri Apr 26 08:53:46 2019 +0100 @@ -216,8 +216,10 @@ return handleSocketError(env, errno); } - /* Disable IPV6_V6ONLY to ensure dual-socket support */ - if (domain == AF_INET6) { + /* + * If IPv4 is available, disable IPV6_V6ONLY to ensure dual-socket support. + */ + if (domain == AF_INET6 && ipv4_available()) { int arg = 0; if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg, sizeof(int)) < 0) {