JDK-7160503 : MulticastSocket.setLoopbackMode(true) doesn't disable loopback mode
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-04-10
  • Updated: 2013-10-03
  • Resolved: 2013-10-03
Related Reports
Duplicate :  
Description
java/net/MulticastSocket/NoLoopbackPackets.java failed on MacOSX with two problems.

First problem, it throws exception java.net.SocketException: Can't assign requested address, Please refer to CR 7160489 to see detailed description.

Second problem, MulticastSocket.setLoopbackMode(true) doesn't disable loopback mode, this issue only happened on MacOSX.
Adding debuging code after line 98, run with jdk 8 promoted build b32 and b33, 
 
try {
                    msock.receive(packet);
                    //debugging
                    System.out.println("receive packet: "+ new String(buf));
                    System.out.println("We should not receive anything from following groups, but we did: "+group);

                    // it is an error if we receive something
                    failedGroups.add(group);
                } catch (SocketTimeoutException e) {
                    // we expect this
                }


Output is:
receive packet: hello world
We should not receive anything from following groups, but we did: /224.1.1.1:56770
receive packet: hello world
We should not receive anything from following groups, but we did: /224.1.1.2:56770

Comments
EVALUATION This is a known issue in Mac OS X (See 7122846). Perhaps we should add this to the ProblemList for macosx in JDK8 also.
11-04-2012