-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
-
windows
test run in IPv6 only environment with IPv4 stack disable and no IPv4 configuration on windows environment
the test logic executed
else {
try {
NetworkInterface.getNetworkInterfaces();
throw new RuntimeException("NetworkInterface.getNetworkInterfaces() should throw SocketException");
} catch (SocketException expected) {
System.out.println("caught expected exception: " + expected);
}
try {
NetworkInterface.networkInterfaces();
throw new RuntimeException("NetworkInterface.networkInterfaces() should throw SocketException");
} catch (SocketException expected) {
System.out.println("caught expected exception: " + expected);
}
}
is returning interfaces --
java.net.preferIPv4Stack (default: false)
If IPv6 is available on the operating system the underlying native socket will be, by default, an IPv6 socket which lets applications connect to, and accept connections from, both IPv4 and IPv6 hosts. However, in the case an application would rather use IPv4 only sockets, then this property can be set to true. The implication is that it will not be possible for the application to communicate with IPv6 only hosts.
java.net.preferIPv6Addresses (default: false)
When dealing with a host which has both IPv4 and IPv6 addresses, and if IPv6 is available on the operating system, the default behavior is to prefer using IPv4 addresses over IPv6 ones. This is to ensure backward compatibility: for example, for applications that depend on the representation of an IPv4 address (e.g. 192.168.1.1). This property can be set to true to change that preference and use IPv6 addresses over IPv4 ones where possible, or system to preserve the order of the addresses as returned by the system-wide resolver.
the implications is that any network interface that doesn't have an IPv4 configuration should be filtered out
the test logic executed
else {
try {
NetworkInterface.getNetworkInterfaces();
throw new RuntimeException("NetworkInterface.getNetworkInterfaces() should throw SocketException");
} catch (SocketException expected) {
System.out.println("caught expected exception: " + expected);
}
try {
NetworkInterface.networkInterfaces();
throw new RuntimeException("NetworkInterface.networkInterfaces() should throw SocketException");
} catch (SocketException expected) {
System.out.println("caught expected exception: " + expected);
}
}
is returning interfaces --
java.net.preferIPv4Stack (default: false)
If IPv6 is available on the operating system the underlying native socket will be, by default, an IPv6 socket which lets applications connect to, and accept connections from, both IPv4 and IPv6 hosts. However, in the case an application would rather use IPv4 only sockets, then this property can be set to true. The implication is that it will not be possible for the application to communicate with IPv6 only hosts.
java.net.preferIPv6Addresses (default: false)
When dealing with a host which has both IPv4 and IPv6 addresses, and if IPv6 is available on the operating system, the default behavior is to prefer using IPv4 addresses over IPv6 ones. This is to ensure backward compatibility: for example, for applications that depend on the representation of an IPv4 address (e.g. 192.168.1.1). This property can be set to true to change that preference and use IPv6 addresses over IPv4 ones where possible, or system to preserve the order of the addresses as returned by the system-wide resolver.
the implications is that any network interface that doesn't have an IPv4 configuration should be filtered out