feat(pmtud/tcp): use the TCP server with highest MSS to run MTU tests

This commit is contained in:
Quentin McGaw
2026-02-19 14:03:46 +00:00
parent fb85ae79d1
commit 8d86470905
10 changed files with 323 additions and 59 deletions
+2 -2
View File
@@ -129,8 +129,8 @@ func runTest(ctx context.Context, dst netip.AddrPort, mtu uint32,
if firstReplyHeader.options.mss != 0 {
// If the server sent an MSS option, make sure our test packet is not larger than that MSS.
tcpDataLength := getPayloadLength(mtu, dst) - constants.BaseTCPHeaderLength
if tcpDataLength > uint32(firstReplyHeader.options.mss) {
diff := tcpDataLength - uint32(firstReplyHeader.options.mss)
if tcpDataLength > firstReplyHeader.options.mss {
diff := tcpDataLength - firstReplyHeader.options.mss
minMTU := constants.MinIPv4MTU
if dst.Addr().Is6() {
minMTU = constants.MinIPv6MTU