From 65dc711c7645a5d7de7f6b2a748fa9e4d0e5f080 Mon Sep 17 00:00:00 2001 From: Val Date: Thu, 21 Sep 2023 11:31:48 +0200 Subject: 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 --- control/controlknobs/controlknobs.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'control/controlknobs/controlknobs.go') diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go index 4d57b30a3..3ea0575a5 100644 --- a/control/controlknobs/controlknobs.go +++ b/control/controlknobs/controlknobs.go @@ -45,6 +45,9 @@ type Knobs struct { // incremental (delta) netmap updates and should treat all netmap // changes as "full" ones as tailscaled did in 1.48.x and earlier. DisableDeltaUpdates atomic.Bool + + // PeerMTUEnable is whether the node should do peer path MTU discovery. + PeerMTUEnable atomic.Bool } // UpdateFromNodeAttributes updates k (if non-nil) based on the provided self @@ -65,6 +68,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability, disableDeltaUpdates = has(tailcfg.NodeAttrDisableDeltaUpdates) oneCGNAT opt.Bool forceBackgroundSTUN = has(tailcfg.NodeAttrDebugForceBackgroundSTUN) + peerMTUEnable = has(tailcfg.NodeAttrPeerMTUEnable) ) if has(tailcfg.NodeAttrOneCGNATEnable) { @@ -80,6 +84,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability, k.OneCGNAT.Store(oneCGNAT) k.ForceBackgroundSTUN.Store(forceBackgroundSTUN) k.DisableDeltaUpdates.Store(disableDeltaUpdates) + k.PeerMTUEnable.Store(peerMTUEnable) } // AsDebugJSON returns k as something that can be marshalled with json.Marshal @@ -96,5 +101,6 @@ func (k *Knobs) AsDebugJSON() map[string]any { "OneCGNAT": k.OneCGNAT.Load(), "ForceBackgroundSTUN": k.ForceBackgroundSTUN.Load(), "DisableDeltaUpdates": k.DisableDeltaUpdates.Load(), + "PeerMTUEnable": k.PeerMTUEnable.Load(), } } -- cgit v1.3-3-g829e