提交 652068bd 编写于 作者: T tyan

8022963: java/net/NetworkInterface/Equals.java fails equality for Windows Teredo Interface

Reviewed-by: chegar
上级 b33463c3
...@@ -33,6 +33,8 @@ import java.io.IOException; ...@@ -33,6 +33,8 @@ import java.io.IOException;
public class TestInterfaces { public class TestInterfaces {
static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
int failures = 0; int failures = 0;
...@@ -85,6 +87,10 @@ public class TestInterfaces { ...@@ -85,6 +87,10 @@ public class TestInterfaces {
continue; continue;
} }
// JDK-8022963, Skip (Windows) Teredo Tunneling seudo-Interface
if (isWindows && ni.getDisplayName().contains("Teredo"))
continue;
NetworkInterface curr = soc.getNetworkInterface(); NetworkInterface curr = soc.getNetworkInterface();
if (!curr.equals(ni)) { if (!curr.equals(ni)) {
System.err.println("MulticastSocket.getNetworkInterface returned: " + curr); System.err.println("MulticastSocket.getNetworkInterface returned: " + curr);
......
...@@ -38,6 +38,8 @@ import java.util.HashMap; ...@@ -38,6 +38,8 @@ import java.util.HashMap;
public class Equals { public class Equals {
static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream bufferedOut = new PrintStream(baos); PrintStream bufferedOut = new PrintStream(baos);
...@@ -59,6 +61,11 @@ public class Equals { ...@@ -59,6 +61,11 @@ public class Equals {
Enumeration<NetworkInterface> nifs2 = NetworkInterface.getNetworkInterfaces(); Enumeration<NetworkInterface> nifs2 = NetworkInterface.getNetworkInterfaces();
while (nifs2.hasMoreElements()) { while (nifs2.hasMoreElements()) {
NetworkInterface ni = nifs2.nextElement(); NetworkInterface ni = nifs2.nextElement();
// JDK-8022963, Skip (Windows)Teredo Tunneling seudo-Interface
if (isWindows && ni.getDisplayName().contains("Teredo"))
continue;
NetworkInterface niOrig = nicMap.get(ni.getName()); NetworkInterface niOrig = nicMap.get(ni.getName());
int h = ni.hashCode(); int h = ni.hashCode();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册