On Wed, 21 Jun 2023 15:45:41 GMT, Alan Bateman <[email protected]> wrote:

>>> 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.
>> 
>> IIRC It has never been possible to create a non-dual `MulticastSocket` / 
>> `DatagramSocket` without setting the property 
>> `-Djava.net.preferIPv4Stack=true`. The possibility to select a protocol 
>> family independently of this property is only available with 
>> `DatagramChannel`.
>
>> IIRC It has never been possible to create a non-dual `MulticastSocket` / 
>> `DatagramSocket` without setting the property 
>> `-Djava.net.preferIPv4Stack=true`. The possibility to select a protocol 
>> family independently of this property is only available with 
>> `DatagramChannel`.
> 
> Right now, Net.canIPv6SocketJoinIPv4Group() returns false on AIX so it will 
> never attempt to join an IPv4 multicast group when the socket is IPv6.  The 
> old DatagamSocketImpl didn't have an eager check, which makes me wonder what 
> AIX supports, it's not clear!

Hi @AlanBateman , 

 I ran the Jtreg tests on **jdk17** and observed  the following tests passed 
unexpectedly when I set the **VM_OPTIONS to 
`-Djdk.net.usePlainDatagramSocketImpl=true`**

1. java/net/MulticastSocket/B6427403.java
2. java/net/MulticastSocket/NoLoopbackPackets.java
3. java/net/MulticastSocket/SetLoopbackMode.java
4. java/net/MulticastSocket/Test.java

I am curious about how setting the `jdk.net.usePlainDatagramSocketImpl` 
property impacts their behavior. I would like to understand why they pass with 
this configuration and whether it has any implications.

Could you please share your insights on this matter? I appreciate your 
assistance in understanding this behavior and ensuring the correctness of the 
tests.

Thank you.

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

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

Reply via email to