PMTUD exploration, start small then grow

This commit is contained in:
Nate Brown
2026-05-05 17:05:50 -05:00
parent 33c2d7277c
commit 16a836a73f
33 changed files with 1036 additions and 11 deletions

View File

@@ -15,4 +15,13 @@ type Device interface {
RoutesFor(netip.Addr) routing.Gateways
SupportsMultiqueue() bool
NewMultiQueueReader() (io.ReadWriteCloser, error)
// SupportsPerPeerMTU reports whether SetPeerMTU is implemented for real on
// this platform. PMTUD requires this; the manager will refuse to enable when
// false even if the operator set tun.max_mtu, because a discovered MTU we
// can't actually install does the operator no good.
SupportsPerPeerMTU() bool
// SetPeerMTU installs a per-peer MTU on the routing table so the kernel will
// surface PTB / EMSGSIZE for inside packets to that peer that would exceed mtu.
// Pass mtu=0 to remove the override and let the device default apply.
SetPeerMTU(addr netip.Addr, mtu int) error
}