RFR: 8284890: Support for Do not fragment IP socket options

Daniel Jeliński djelinski at openjdk.java.net
Fri Apr 15 10:08:38 UTC 2022


On Thu, 14 Apr 2022 16:04:22 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

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

> 71:     if (family == AF_INET) {
> 72:         opt = optval;
> 73:         rv = setsockopt(fd, IPPROTO_IP, IP_DONTFRAGMENT, (char *)&opt, sizeof(int));

Why do we only use `IPV6_MTU_DISCOVER` but not `IP_MTU_DISCOVER`? As far as I can tell, `IP_DONTFRAGMENT` alone doesn't guarantee that the DF bit will be set.

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

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



More information about the build-dev mailing list