hotfix(pmtud/tcp): send MTU data in first and only ACK packet

- less likely to be flagged
- correct using TCP fast-open
This commit is contained in:
Quentin McGaw
2026-02-16 19:56:14 +00:00
parent dc78b4ecce
commit 201d1041f4
+4 -11
View File
@@ -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 {