[openjdk-x] Bind to a multicast address fails

Alan Bateman Alan.Bateman at oracle.com
Sun Sep 9 07:16:49 UTC 2018


On 07/09/2018 13:22, Andre Naujoks wrote:
> :
> I have not tried joining IPv4 groups on an IPv6 socket through java,
> since we do not use IPv4 at all in this particular environment. I have
> tried setting IP_MULTICAST_ALL to 0 in the IPv6 scenario (in a C++
> project), hoping it would help, but it did not. Hence the patch for the
> linux kernel.
>
> Would it actually help, if I tried the IPv4 multicast group bind on an
> IPv6 socket?
>
> The bind to an address would be a workaround for the missing
> IPV6_MULTICAST_ALL handling.
>
The tests that we have for the scenario of two sockets bound to the same 
port but joining different multicast groups seems to be mostly using 
IPv4 multicast addresses so one thing out this discussion is that we may 
need to expand the tests to IPv6 multicast addresses. As the existing 
tests use IPv6 sockets (when not disabled on the system or in the test 
run) then it means they are exercising IP_MULTICAST_ALL=0 so I think we 
can conclude that disabling IP_MULTICAST_ALL works correctly for IPv6 
sockets when joining IPv4 multicast groups. If the tests were expanded 
to IPv6 multicast groups then I assume we will run into the need for 
IPV6_MULTICAST_ALL too.

As regards the patch to NET_InetAddressToSockaddr to set the scope_id 
then it looks correct but need testing (both for bind and connect). I 
see JDK-8210493 has been picked up by Vyom.

-Alan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20180909/3a151391/attachment.html>


More information about the net-dev mailing list