control,tailcfg,wgengine/magicsock: add nodeAttr to enable/disable peer MTU

Add a nodeAttr to enable/disable peer path MTU discovery.

Updates #311

Signed-off-by: Val <valerie@tailscale.com>
This commit is contained in:
Val
2023-09-21 11:31:48 +02:00
committed by valscale
parent 95635857dc
commit 65dc711c76
4 changed files with 102 additions and 0 deletions

View File

@@ -34,6 +34,14 @@ func (c *Conn) ShouldPMTUD() bool {
}
return v
}
if c.controlKnobs != nil {
if v := c.controlKnobs.PeerMTUEnable.Load(); v {
if debugPMTUD() {
c.logf("magicsock: peermtu: peer path MTU discovery enabled by control")
}
return v
}
}
if debugPMTUD() {
c.logf("magicsock: peermtu: peer path MTU discovery set by default to false")
}