-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b09
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8369399 | 25.0.2 | Hari Prasad Kummari | P4 | Resolved | Fixed | master |
This is part of a series of diagnostic output updates to java.net tests to assist in the analysis of failures in IPv6 only environments
for Linux there is no IPv4 configuration but the IPv4 stack remains enabled
For macOS, and windows the IPv4 stacks are disabled, and IPv4 configuration removed
add IPSupport::printPlatformSupport(System.out);
to the start of main
public class IPv4Only {
public static void main(String[] args) throws Exception {
IPSupport::printPlatformSupport(System.out);
if (IPSupport.hasIPv4()) {
System.out.println("Testing IPv4");
Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
while (nifs.hasMoreElements()) {
NetworkInterface nif = nifs.nextElement();
Enumeration<InetAddress> addrs = nif.getInetAddresses();
while (addrs.hasMoreElements()) {
InetAddress hostAddr = addrs.nextElement();
if ( hostAddr instanceof Inet6Address ){
throw new RuntimeException( "NetworkInterfaceV6List failed - found v6 address " + hostAddr.getHostAddress() );
}
}
}
for Linux there is no IPv4 configuration but the IPv4 stack remains enabled
For macOS, and windows the IPv4 stacks are disabled, and IPv4 configuration removed
add IPSupport::printPlatformSupport(System.out);
to the start of main
public class IPv4Only {
public static void main(String[] args) throws Exception {
IPSupport::printPlatformSupport(System.out);
if (IPSupport.hasIPv4()) {
System.out.println("Testing IPv4");
Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
while (nifs.hasMoreElements()) {
NetworkInterface nif = nifs.nextElement();
Enumeration<InetAddress> addrs = nif.getInetAddresses();
while (addrs.hasMoreElements()) {
InetAddress hostAddr = addrs.nextElement();
if ( hostAddr instanceof Inet6Address ){
throw new RuntimeException( "NetworkInterfaceV6List failed - found v6 address " + hostAddr.getHostAddress() );
}
}
}
- backported by
-
JDK-8369399 Add IPSupport::printPlatformSupport to java/net/NetworkInterface/IPv4Only.java
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk25u/6569f3ef
-
Commit(master) openjdk/jdk/2f1aed2a
-
Review(master) openjdk/jdk25u/273
-
Review(master) openjdk/jdk/26265