7060243: (dc) Multicasting tests fail on Windows XP if IPv6 is enabled
Reviewed-by: alanb
This commit is contained in:
parent
90502358ad
commit
f953b5c397
@ -57,11 +57,22 @@ class NetworkConfiguration {
|
|||||||
return ip6Interfaces.get(nif);
|
return ip6Interfaces.get(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IPv6 not supported for Windows XP/Server 2003
|
||||||
|
static boolean isIPv6Supported() {
|
||||||
|
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||||
|
String ver = System.getProperty("os.version");
|
||||||
|
int major = Integer.parseInt(ver.split("\\.")[0]);
|
||||||
|
return (major >= 6);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static NetworkConfiguration probe() throws IOException {
|
static NetworkConfiguration probe() throws IOException {
|
||||||
Map<NetworkInterface,List<InetAddress>> ip4Interfaces =
|
Map<NetworkInterface,List<InetAddress>> ip4Interfaces =
|
||||||
new HashMap<NetworkInterface,List<InetAddress>>();
|
new HashMap<NetworkInterface,List<InetAddress>>();
|
||||||
Map<NetworkInterface,List<InetAddress>> ip6Interfaces =
|
Map<NetworkInterface,List<InetAddress>> ip6Interfaces =
|
||||||
new HashMap<NetworkInterface,List<InetAddress>>();
|
new HashMap<NetworkInterface,List<InetAddress>>();
|
||||||
|
boolean isIPv6Supported = isIPv6Supported();
|
||||||
|
|
||||||
// find the interfaces that support IPv4 and IPv6
|
// find the interfaces that support IPv4 and IPv6
|
||||||
List<NetworkInterface> nifs = Collections
|
List<NetworkInterface> nifs = Collections
|
||||||
@ -81,7 +92,7 @@ class NetworkConfiguration {
|
|||||||
}
|
}
|
||||||
list.add(addr);
|
list.add(addr);
|
||||||
ip4Interfaces.put(nif, list);
|
ip4Interfaces.put(nif, list);
|
||||||
} else if (addr instanceof Inet6Address) {
|
} else if (isIPv6Supported && (addr instanceof Inet6Address)) {
|
||||||
List<InetAddress> list = ip6Interfaces.get(nif);
|
List<InetAddress> list = ip6Interfaces.get(nif);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new LinkedList<InetAddress>();
|
list = new LinkedList<InetAddress>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user