RFR: 8308807: [AIX] MulticastSocket and jdp test fails due to joinGroup

Deepa Kumari duke at openjdk.org
Tue Jun 6 06:06:51 UTC 2023


On Thu, 25 May 2023 07:37:27 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> DatagramSocket delegates to an inner DatagramSocket object. Irrespective of whether datagramSocket is IPv4 or IPv6, we create an IPv6 datagramChannel as its's delegate. So, This can cause problems with operations like joinGroup. 
>> 
>> On AIX, IPv6 datagramSocket can not join an IPv4 multicast group.
>> 
>> These failures can be fixed by making sure that the delegate created for a datagram socket has the same protocol family. 
>> 
>> 
>> 
>> 
>> Reported Issue : [JDK-8308807](https://bugs.openjdk.org/browse/JDK-8308807)
>
> I've moved the JBS issue to the right place and fix the description.
> 
> The changes proposed here impact all platforms and will require discussion and cleanup. If I understand the intent, if you create a DatagramSocket or MulticastSocket that is bound to a specific local address then you want to use that to determine if the underlying socket is IPv4 or IPv6. That might be okay but multicasting normally means binding to the wildcard address so it doesn't help - I assume it only works for the test because new InetSocketAddress(port).getAddress() returns an Inet4Address so you get an IPv4 socket. It should only create a dual IPv4/IPv6 socket for this case so this is why it will break other platforms. In any case, can you look at the isXXX methods defined by sun.nio.ch.Net to see how it is handled on other platforms.

Yes, I agree with @AlanBateman  and @msheppar . Even when we try to have an IPv4 multicast socket join an IPv4 multicast group, we still fail because the delegate that is created for an IPv4 multicast socket is IPv4/IPv6 (dual stack) in nature. AIX does not allow dual stack (IPv4/IPv6) sockets to join IPv4 multicast groups.

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

PR Comment: https://git.openjdk.org/jdk/pull/14142#issuecomment-1577968863


More information about the nio-dev mailing list