RFR: 8284890: Support for Do not fragment IP socket options [v5]

Daniel Fuchs dfuchs at openjdk.java.net
Tue Apr 19 15:02:25 UTC 2022


On Tue, 19 Apr 2022 14:47:01 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

>> Hi,
>> 
>> Could I get the following PR review please? It adds a new JDK specific extended socket option
>> called IP_DONTFRAGMENT, which disables IP packet fragmentation in both IPv4 and IPv6
>> UDP sockets (NIO DatagramChannels). For IPv4 in particular, it sets the DF (Dont Fragment) bit
>> in the IP header. There is no equivalent in the IPv6 packet header as fragmentation is implemented
>> exclusively by the sending and receiving nodes.
>> 
>> Thanks,
>> Michael
>
> Michael McMahon has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix whitespace

src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c line 112:

> 110:             return optval;
> 111:         }
> 112:             handleError(env, rv, "get option IP_DONTFRAGMENT failed");

Is there some indentation issue here?

test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java line 44:

> 42:         StandardProtocolFamily fam = args[0].equals("ipv4") ? INET : INET6;
> 43:         System.out.println("Family = " + fam);
> 44:         testDatagramChannel(args, fam);

Shouldn't there be a testcase for when DatagramChannel is opened using the no arg factory method `DatagramChannel.open()`?

test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java line 47:

> 45:         try (DatagramSocket c = new DatagramSocket()) {
> 46:             testDatagramSocket(c);
> 47:         }

Can't you test `MulticastSocket` in exactly the same way? Why is there a specific test method for `MulticastSocket`?

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

PR: https://git.openjdk.java.net/jdk/pull/8245



More information about the build-dev mailing list