6884837: JTReg test SetOutgoingIf is not correct
authorptisnovs
Wed, 30 Sep 2009 11:49:10 +0200
changeset 3945 391194a1b78a
parent 3944 e098e010b520
child 3947 49663e664250
6884837: JTReg test SetOutgoingIf is not correct Summary: Added check of network interfaces status Reviewed-by: alanb, chegar
jdk/test/java/net/MulticastSocket/SetOutgoingIf.java
--- a/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java	Thu Sep 24 21:35:34 2009 +0800
+++ b/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java	Wed Sep 30 11:49:10 2009 +0200
@@ -70,7 +70,8 @@
         //
         List<NetworkInterface> nics = new ArrayList<NetworkInterface>();
         for (NetworkInterface nic : Collections.list(NetworkInterface.getNetworkInterfaces())) {
-            if (!nic.isLoopback())
+            // we should use only network interfaces with multicast support which are in "up" state
+            if (!nic.isLoopback() && nic.supportsMulticast() && nic.isUp())
                 nics.add(nic);
         }
         if (nics.size() <= 1) {