wgengine/magicsock: add client flag and envknob to disable heartbeat (#5638)

Baby steps towards turning off heartbeat pings entirely as per #540.
This doesn't change any current magicsock functionality and requires additional
changes to send/disco paths before the flag can be turned on.

Updates #540

Change-Id: Idc9a72748e74145b068d67e6dd4a4ffe3932efd0
Signed-off-by: Jenny Zhang <jz@tailscale.com>

Signed-off-by: Jenny Zhang <jz@tailscale.com>
This commit is contained in:
phirework
2022-09-16 23:48:46 -04:00
committed by GitHub
parent 65c24b6334
commit 5c42990c2f
4 changed files with 24 additions and 5 deletions

View File

@@ -1456,6 +1456,10 @@ type Debug struct {
// re-enabled for the lifetime of the process.
DisableLogTail bool `json:",omitempty"`
// EnableSilentDisco disables the use of heartBeatTimer in magicsock and attempts to
// handle disco silently. See issue #540 for details.
EnableSilentDisco bool `json:",omitempty"`
// Exit optionally specifies that the client should os.Exit
// with this code.
Exit *int `json:",omitempty"`