Code Review Request: 7060243: (dc) Multicasting tests fail on Windows XP if IPv6 is enabled (original) (raw)

Kurchi Hazra kurchi.subhra.hazra at oracle.com
Fri Aug 26 13:06:30 PDT 2011


Hi,

java/nio/channels/DatagramChannel/BasicMulticastTests.java and java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java were throwing an UnSupportedOperationException on Windows XP 32 bit,

with an IPV6 stack, since NIO Channels do not support the old stack. Both these testcases rely on the InetAddresses returned by probe() in test/java/nio/channels/DatagramChannel/NetworkConfiguration.java. Hence, the fix was to modify probe() in NetworkConfiguration.java to not return the list of IPV6 InetAddresses if the OS is Windows and the version is lower than 6.

Submitting hg diff since I do not have an openjdk account:

diff --git a/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java b/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java --- a/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java +++ b/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java @@ -27,6 +27,7 @@ import java.io.IOException;

/**

@@ -62,7 +63,7 @@ class NetworkConfiguration { new HashMap<NetworkInterface,List>(); Map<NetworkInterface,List> ip6Interfaces = new HashMap<NetworkInterface,List>();

@@ -70,7 +71,6 @@ class NetworkConfiguration { // ignore intertaces that are down or don't support multicast if (!nif.isUp() || !nif.supportsMulticast() || nif.isLoopback()) continue;

          List<InetAddress>  addrs = Collections.list(nif.getInetAddresses());
          for (InetAddress addr: addrs) {
              if (!addr.isAnyLocalAddress()) {

@@ -81,7 +81,7 @@ class NetworkConfiguration { } list.add(addr); ip4Interfaces.put(nif, list);

@@ -94,4 +94,16 @@ class NetworkConfiguration { } return new NetworkConfiguration(ip4Interfaces, ip6Interfaces); } +

}

Thanks,

-- -Kurchi



More information about the nio-dev mailing list