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

Alan Bateman alanb at openjdk.org
Fri Jun 16 07:48:13 UTC 2023


On Thu, 15 Jun 2023 15:05:19 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 two additional commits since the last revision:
> 
>  - typo
>  - review update

Can you look at test/jdk/java/nio/channels/DatagramChannel/Promiscuous.java? I wonder if this should be updated to exercise the test with two IPv6 multicast groups? In passing, I assume the check for the OS version isn't needed in this test anymore.

As regards the new test then I think the naming should be a bit more consistent with the existing tests if possible. The existing test for IP_MULTICAST_ALL is Promiscuous so maybe the new test is PromiscuousIPv6 or something with "IPv6" in the name?

The test launches "uname -r", maybe it can use the Platform test infra class instead.

The class initializer probes for interfaces that support IPv6 multicasting. Can this be moved to the main method so that it's easier to see in main why the test is skipping?

If < 4.20 then I think the test should just skip on Linux. No need to create a socket + close it. If we have an issue here then all DatagramChannel tests would fail.

The select(2000) might not be enough on slow machines. So if we are keeping this test then I think it will need a few rounds of cleanup to make it more robust.

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

PR Comment: https://git.openjdk.org/jdk/pull/14491#issuecomment-1594258465


More information about the nio-dev mailing list