Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8290349

IP_DONTFRAGMENT doesn't set DF bit in IPv4 header

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 20
    • None
    • core-libs
    • b10

    Description

      Environment: Windows 10, 21H2

      To reproduce, use Wireshark to capture the traffic on loopback interface while running the following code:

              DatagramChannel channel = DatagramChannel.open();
              channel.setOption(ExtendedSocketOptions.IP_DONTFRAGMENT, true);
              channel.send(ByteBuffer.allocate(0),
                      new InetSocketAddress("127.0.0.1", 1234));

      Check the IPv4 header of the captured packet.

      Expected result:

      Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
      ...
          Flags: 0x40, Don't fragment

      Actual result:
      Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
      ...
          Flags: 0x00

      Workaround:
      Open an IPv4 channel:
              DatagramChannel channel = DatagramChannel.open(StandardProtocolFamily.INET);

      Attachments

        Issue Links

          Activity

            People

              djelinski Daniel Jelinski
              djelinski Daniel Jelinski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: