changeset 30810:cbb29036f026

8077377: java/net/MulticastSocket/SetOutgoingIf.java fails intermittently with NullPointerException Summary: ignore "stray" packets received from non test interface Reviewed-by: alanb, chegar
author msheppar
date Wed, 27 May 2015 13:23:40 +0100
parents 2c40760f65a9
children 58432ddf9528
files jdk/test/java/net/MulticastSocket/SetOutgoingIf.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java	Wed May 27 13:04:32 2015 +0100
+++ b/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java	Wed May 27 13:23:40 2015 +0100
@@ -156,12 +156,13 @@
                 // now check which network interface this packet comes from
                 NetworkInterface from = NetworkInterface.getByInetAddress(packet.getAddress());
                 NetworkInterface shouldbe = nic;
-                if (!from.equals(shouldbe)) {
-                    System.out.println("Packets on group "
+                if (from != null) {
+                    if (!from.equals(shouldbe)) {
+                        System.out.println("Packets on group "
                                         + group + " should come from "
                                         + shouldbe.getName() + ", but came from "
                                         + from.getName());
-                    //throw new RuntimeException("Test failed.");
+                    }
                 }
 
                 mcastsock.leaveGroup(new InetSocketAddress(group, PORT), nic);