summaryrefslogtreecommitdiffhomepage
path: root/control/controlknobs/controlknobs.go
diff options
context:
space:
mode:
authorJordan Whited <jordan@tailscale.com>2023-11-13 10:05:04 -0800
committerGitHub <noreply@github.com>2023-11-13 10:05:04 -0800
commite84873692706002db42db5ff07179470c6aa50e6 (patch)
treee6f196fc47e54ea18c9cd75c0a9bc8481c2229e8 /control/controlknobs/controlknobs.go
parentfe7f7bff4fb07b11165b1f00e46301e2a45794ad (diff)
downloadtailscale-e84873692706002db42db5ff07179470c6aa50e6.tar.xz
tailscale-e84873692706002db42db5ff07179470c6aa50e6.zip
control/controlknobs,wgengine/magicsock: implement SilentDisco toggle (#10195)
This change exposes SilentDisco as a control knob, and plumbs it down to magicsock.endpoint. No changes are being made to magicsock.endpoint disco behavior, yet. Updates #540 Signed-off-by: Jordan Whited <jordan@tailscale.com> Co-authored-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
-rw-r--r--control/controlknobs/controlknobs.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go
index e64bc8011..c0ee040b7 100644
--- a/control/controlknobs/controlknobs.go
+++ b/control/controlknobs/controlknobs.go
@@ -52,6 +52,10 @@ type Knobs struct {
// DisableDNSForwarderTCPRetries is whether the DNS forwarder should
// skip retrying truncated queries over TCP.
DisableDNSForwarderTCPRetries atomic.Bool
+
+ // SilentDisco is whether the node should suppress disco heartbeats to its
+ // peers.
+ SilentDisco atomic.Bool
}
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
@@ -74,6 +78,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability,
forceBackgroundSTUN = has(tailcfg.NodeAttrDebugForceBackgroundSTUN)
peerMTUEnable = has(tailcfg.NodeAttrPeerMTUEnable)
dnsForwarderDisableTCPRetries = has(tailcfg.NodeAttrDNSForwarderDisableTCPRetries)
+ silentDisco = has(tailcfg.NodeAttrSilentDisco)
)
if has(tailcfg.NodeAttrOneCGNATEnable) {
@@ -91,6 +96,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability,
k.DisableDeltaUpdates.Store(disableDeltaUpdates)
k.PeerMTUEnable.Store(peerMTUEnable)
k.DisableDNSForwarderTCPRetries.Store(dnsForwarderDisableTCPRetries)
+ k.SilentDisco.Store(silentDisco)
}
// AsDebugJSON returns k as something that can be marshalled with json.Marshal
@@ -109,5 +115,6 @@ func (k *Knobs) AsDebugJSON() map[string]any {
"DisableDeltaUpdates": k.DisableDeltaUpdates.Load(),
"PeerMTUEnable": k.PeerMTUEnable.Load(),
"DisableDNSForwarderTCPRetries": k.DisableDNSForwarderTCPRetries.Load(),
+ "SilentDisco": k.SilentDisco.Load(),
}
}