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>
This commit is contained in:
Jordan Whited
2023-11-13 10:05:04 -08:00
committed by GitHub
parent fe7f7bff4f
commit e848736927
5 changed files with 44 additions and 1 deletions

View File

@@ -440,6 +440,13 @@ func (de *endpoint) heartbeat() {
de.heartBeatTimer = time.AfterFunc(heartbeatInterval, de.heartbeat)
}
// setHeartbeatDisabled sets heartbeatDisabled to the provided value.
func (de *endpoint) setHeartbeatDisabled(v bool) {
de.mu.Lock()
defer de.mu.Unlock()
de.heartbeatDisabled = v
}
// wantFullPingLocked reports whether we should ping to all our peers looking for
// a better path.
//