On Thu, 25 May 2023 07:14:19 GMT, Deepa Kumari <[email protected]> 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)

at a cursory glance, and without a deep dive to follow any associated call 
flows into native code, these changes look like the are not aligned with the 
semantics espoused in the systems newtwork properties, especially  that of the 
first:

IPv4 / IPv6

    java.net.preferIPv4Stack (default: false)
    If IPv6 is available on the operating system the underlying native socket 
will be, by default, an IPv6 socket which lets applications connect to, and 
accept connections from, both IPv4 and IPv6 hosts. However, in the case an 
application would rather use IPv4 only sockets, then this property can be set 
to true. The implication is that it will not be possible for the application to 
communicate with IPv6 only hosts.

    java.net.preferIPv6Addresses (default: false)
    When dealing with a host which has both IPv4 and IPv6 addresses, and if 
IPv6 is available on the operating system, the default behavior is to prefer 
using IPv4 addresses over IPv6 ones. This is to ensure backward compatibility: 
for example, for applications that depend on the representation of an IPv4 
address (e.g. 192.168.1.1). This property can be set to true to change that 
preference and use IPv6 addresses over IPv4 ones where possible, or system to 
preserve the order of the addresses as returned by the system-wide resolver

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

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

Reply via email to