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

Alan Bateman alanb at openjdk.org
Fri Jun 16 16:40:15 UTC 2023


On Fri, 16 Jun 2023 16:08:08 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:
> 
>  - removed new test and added to existing Promiscuous test
>  - test update

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

> 210: 
> 211:             // Linux allows IPv6 sockets join IPv4 multicast groups
> 212:             if (Platform.isLinux())

If you can, it would be useful to double check it is Linux specific, I would expect it should pass on Windows and macOS too.

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

> 148:     static void test(ProtocolFamily family,
> 149:                      NetworkInterface nif,
> 150:                      boolean bindToWildCard,

Wildcard rather than WildCard :-)

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

> 208: 
> 209:         if (!Platform.isLinux()) {
> 210:             throw new SkippedException("This test should be run only on Linux");

The test has `@requires os.family == "linux" so it only runs on Linux. It doesn't need both, and maybe it will pass on Windows too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14491#discussion_r1232482223
PR Review Comment: https://git.openjdk.org/jdk/pull/14491#discussion_r1232485030
PR Review Comment: https://git.openjdk.org/jdk/pull/14491#discussion_r1232483517


More information about the nio-dev mailing list