diff --git a/internal/pmtud/tcp/tcp.go b/internal/pmtud/tcp/tcp.go index 79decfb9..ad9e544e 100644 --- a/internal/pmtud/tcp/tcp.go +++ b/internal/pmtud/tcp/tcp.go @@ -103,19 +103,12 @@ func runTest(ctx context.Context, fd fileDescriptor, return fmt.Errorf("%w: expected %d, got %d", errTCPSynAckAckMismatch, synSeq+1, synAckAck) } - // Send a no-data ACK packet to finish the 3-way handshake. - const ackMTU = 0 // no data payload initially - ackPacket := createACKPacket(src, dst, synAckAck, synAckSeq+1, ackMTU) + // Send an ACK packet to finish the 3-way handshake, together with the + // data to test the MTU, using TCP fast-open. + ackPacket := createACKPacket(src, dst, synAckAck, synAckSeq+1, mtu) err = sendTo(fd, ackPacket, sendToFlags, dstSockAddr) if err != nil { - return fmt.Errorf("sending ACK-without-data packet: %w", err) - } - - // Send a data ACK packet to test the MTU given. - ackPacket = createACKPacket(src, dst, synAckAck, synAckSeq+1, mtu) - err = sendTo(fd, ackPacket, sendToFlags, dstSockAddr) - if err != nil { - return fmt.Errorf("sending ACK-with-data packet: %w", err) + return fmt.Errorf("sending ACK packet: %w", err) } select {