RFR: 8241800: Disable IPV6_MULTICAST_ALL to prevent interference from all multicast groups [v7]

Alan Bateman alanb at openjdk.org
Mon Jun 19 15:41:07 UTC 2023


On Mon, 19 Jun 2023 15:37:54 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

>> Hi,
>> 
>> Can I get the following change reviewed please? It disables the IPV6_MULTICAST_ALL socket option on UDP sockets on Linux systems which support the option (kernel version 4.20+). This has the effect of disabling the surprising default behavior of multicast sockets on Linux where sockets can receive packets sent to groups the receiver has not joined, if some other socket has joined that group on the same system.
>> 
>> The equivalent behavior has already been implemented for IPv4 sockets.
>> 
>> Thanks,
>> Michael.
>
> Michael McMahon has updated the pull request incrementally with one additional commit since the last revision:
> 
>   whitespace

test/jdk/java/nio/channels/DatagramChannel/Promiscuous.java line 46:

> 44: 
> 45: import jdk.test.lib.NetworkConfiguration;
> 46: import jdk.test.lib.Platform;

I assume this isn't needed for the current patch.

test/jdk/java/nio/channels/DatagramChannel/Promiscuous.java line 212:

> 210: 
> 211:             // test IPv6 sockets joining IPv4 multicast groups
> 212:             test(UNSPEC, nif, ip4Group1, ip4Group2);

The SAP and/or IBM folks that maintain the AIX port will probably have to adjust this to skip on that platform.

test/jdk/java/nio/channels/DatagramChannel/PromiscuousIPv6.java line 213:

> 211:             int major = Platform.getOsVersionMajor();
> 212:             int minor = Platform.getOsVersionMinor();
> 213:             hasIPV6MulticastAll = Platform.isOSX() || (major > 4) || ((major == 4 && minor >= 20));

The version check should be Linux only.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14491#discussion_r1234219653
PR Review Comment: https://git.openjdk.org/jdk/pull/14491#discussion_r1234220343
PR Review Comment: https://git.openjdk.org/jdk/pull/14491#discussion_r1234221155


More information about the nio-dev mailing list