hotfix(pmtud/tcp): return an error if no MSS destination server worked

This commit is contained in:
Quentin McGaw
2026-02-20 16:25:02 +00:00
parent 1dee183a70
commit 7fbf2cbee3
+6
View File
@@ -12,6 +12,8 @@ import (
"github.com/qdm12/gluetun/internal/pmtud/ip"
)
var errTCPServersUnreachable = errors.New("all TCP servers are unreachable")
// findHighestMSSDestination finds the destination with the highest
// MSS amongst the provided destinations.
func findHighestMSSDestination(ctx context.Context, familyToFD map[int]fileDescriptor,
@@ -65,6 +67,10 @@ func findHighestMSSDestination(ctx context.Context, familyToFD map[int]fileDescr
}
}
if mss == 0 { // no MSS found for any destination
return netip.AddrPort{}, 0, fmt.Errorf("%w (%d servers)", errTCPServersUnreachable, len(dsts))
}
maxPossibleMTU = ip.HeaderLength(dst.Addr().Is4()) + constants.BaseTCPHeaderLength + mss
logger.Debugf("server %s has the highest MSS %d allowing to test the MTU up to %d",
dst, mss, maxPossibleMTU)