On Tue, 13 Jun 2023 07:01:28 GMT, Alan Bateman <[email protected]> wrote:

>>> Well, in that area we always had deviations on AIX, so definitely this 
>>> rings a bell. However, since AIX was not the most important platform for us 
>>> and that particular IPv6/IPv4 multicast feature didn't seem to be mission 
>>> critical and wouldn't fail TCK tests, we rather resorted to excluding some 
>>> tests internally, I believe. But it would be good to really resolve this 
>>> compatibility/spec/documentation issue, if possible.
>> 
>> Thanks. So yes, if some/all of the tests for multicasting were excluded then 
>> it helps explain why it didn't come up. The spec doesn't require that a 
>> DatgaramSocket or DatagramChannel to an IPv6 socket be capable of joining an 
>> IPv4 multicast group. So the tests in several areas might need updates as I 
>> don't think we've had a platform to date where it wasn't possible.
>
>> @AlanBateman , is it possible if there is a central place where the change 
>> could me made for fixing all of the multicast test cases?
> 
> Your starting point is probably to exclude all of the tests that are failing. 
> This will be tests for DatagramSocket/MulticastSocket, DatagramChannel and 
> the tests for the JMX agent that use the discovery protocol. Once they are 
> excluded then you can start working through the issues.
> 
> For the JMX agent, then I would expect that if if the system property 
> com.sun.management.jdp.address is configured then the protocol family is 
> known so it should be possible to create the DatagramChannel to use that 
> protocol family. It might do so already, but you can check that.
> 
> For the networking and NIO tests then you probably should look at 
> jdk.test.lib.NetworkConfiguration. That has a number of AIX specific comments 
> that may be out of date. After that I think you will need to work through the 
> tests one by one. Between NetworkConfiguration and 
> jdk.test.lib.net.IPSupport, I would expect you have all the infrastructure 
> needed for the tests to not attempt to join IPv4 multicast groups when 
> IPSupport.hasIPv6() is true.

> > 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.
> 
> The "Platform dependencies" section in the java.nio.channels.MulticastChannel 
> (implemented by DatagramChannel) makes it clear that it is implementation 
> specific as to whether a channel to an IPv6 socket can join an IPv4 multicast 
> group. The recommendation is to specify the protocol family when creating the 
> channel. Legacy DatagramSocket/MulticastSocket do not define a constructor 
> that allows the protocol family be specified at xxxSocket create time. That 
> issue has been there since JDK 1.4 when IPv6 support was added. I'm curious 
> why this might be coming up with AIX now.

IIUC what @deepa181  is saying, it looks like the "IPv4 socket being unable to 
join an IPv4 multicast group" problems surfaced when we moved away from 
`PlainDatagramSocketImpl` in JDK 17? Probably because the `delegate` created 
does not factor in the `ProtocolFamily` and though we started with attempting 
to have an "IPv4 multicast socket join an IPv4 group", we end up trying to have 
an "IPv4/IPv6 dual-stack socket (the delegate) join an IPv4 group" which AIX 
doesn't permit.

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

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

Reply via email to