RFR: 8305089: Implement missing socket options on AIX [v3]

Varada M duke at openjdk.org
Thu Apr 6 06:22:09 UTC 2023


On Wed, 5 Apr 2023 12:33:40 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> Hi, could you check if the value returned by [Java_sun_nio_ch_Net_shouldSetBothIPv4AndIPv6Options0](https://github.com/openjdk/jdk/blob/0deb648985b018653ccdaf193dc13b3cf21c088a/src/java.base/unix/native/libnio/ch/Net.c#L159-L167) is correct on AIX?
> 
> More specifically, this piece of code should throw an exception mentioning that the message is too big for the underlying transport:
> 
> ```
> DatagramChannel channel = DatagramChannel.open(StandardProtocolFamily.INET6);
> channel.setOption(ExtendedSocketOptions.IP_DONTFRAGMENT, true);
> channel.send(ByteBuffer.allocate(64000),
>                     new InetSocketAddress("bugs.openjdk.org", 1234));
> ```
> 
> on Windows and Linux it works (i.e. throws) because `shouldSetBothIPv4AndIPv6Options0` returns `true`; on MacOSX it doesn't work even if `shouldSetBothIPv4AndIPv6Options0` returns `true`, so we return `false`; it would be interesting how AIX behaves here.

Hi @djelinski , On AIX I'm getting socket exception stating the message is too long.

STDERR:
java.net.SocketException: Message too long
        at java.base/sun.nio.ch.DatagramChannelImpl.send0(Native Method)
        at java.base/sun.nio.ch.DatagramChannelImpl.sendFromNativeBuffer(DatagramChannelImpl.java:945)
        at java.base/sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:921)
        at java.base/sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:864)
        at DontFragmentTest.main(DontFragmentTest.java:54)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
        at java.base/java.lang.Thread.run(Thread.java:1623)

JavaTest Message: Test threw exception: java.net.SocketException: Message too long

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

PR Comment: https://git.openjdk.org/jdk/pull/13240#issuecomment-1498551079



More information about the build-dev mailing list