changeset 14137:725743673498

8151444: JDP not working Summary: Don't set IP_MULTICAST_IF explicitly Reviewed-by: sla, ysuenaga
author dsamersoff
date Wed, 23 Mar 2016 21:40:20 +0300
parents 0442990ca8ad
children 0dfea12d7199
files src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java test/sun/management/jdp/JdpDefaultsTest.java test/sun/management/jdp/JdpTestCase.java
diffstat 3 files changed, 1 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java	Tue Mar 22 21:27:55 2016 +0000
+++ b/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java	Wed Mar 23 21:40:20 2016 +0300
@@ -99,30 +99,7 @@
                 throw new JdpException("Unable to bind to source address");
             }
             channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, interf);
-        } else {
-            Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
-            boolean succeed = false;
-
-            while (nics.hasMoreElements()) {
-                NetworkInterface nic = nics.nextElement();
-
-                if (nic.isUp() && nic.supportsMulticast()) {
-                    try {
-                        channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, nic);
-                        succeed = true;
-                    } catch (IOException ex) {
-                        // pass
-                    }
-                }
-
-            }
-
-            if (!succeed) {
-                throw new JdpException("Unable to bind to any interfaces.");
-            }
-
         }
-
     }
 
     /**
--- a/test/sun/management/jdp/JdpDefaultsTest.java	Tue Mar 22 21:27:55 2016 +0000
+++ b/test/sun/management/jdp/JdpDefaultsTest.java	Wed Mar 23 21:40:20 2016 +0300
@@ -57,7 +57,6 @@
                 "-Dcom.sun.management.jmxremote.autodiscovery=true",
                 "-Dcom.sun.management.jdp.pause=1",
                 "-Dcom.sun.management.jdp.name=" + jdpName,
-                "-Dcom.sun.management.jdp.address=224.0.23.178",
                 "-Djava.util.logging.SimpleFormatter.format='%1$tF %1$tT %4$-7s %5$s %n'",
                 testName
         };
--- a/test/sun/management/jdp/JdpTestCase.java	Tue Mar 22 21:27:55 2016 +0000
+++ b/test/sun/management/jdp/JdpTestCase.java	Wed Mar 23 21:40:20 2016 +0300
@@ -122,7 +122,7 @@
      */
     private void jdpPacketReceived(Map<String, String> payload) throws Exception {
         final String instanceName = payload.get("INSTANCE_NAME");
-        if (instanceName.equals(connection.instanceName)) {
+        if (instanceName != null && instanceName.equals(connection.instanceName)) {
             packetFromThisVMReceived(payload);
         } else {
             packetFromOtherVMReceived(payload);