diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2023-09-11 21:44:38 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <brad@danga.com> | 2023-09-12 06:17:14 -0700 |
| commit | 7c1ed38ab399b82d7b5951e47491784ba0bf97c7 (patch) | |
| tree | a91d093a387178dd33538b19e2c3a89c88967125 /control/controlknobs/controlknobs.go | |
| parent | 12d468532873ca7a8a88e43c45e5ebe538ee170a (diff) | |
| download | tailscale-7c1ed38ab399b82d7b5951e47491784ba0bf97c7.tar.xz tailscale-7c1ed38ab399b82d7b5951e47491784ba0bf97c7.zip | |
ipn/ipnlocal: fix missing controlknobs.Knobs plumbing
I missed connecting some controlknobs.Knobs pieces in 4e91cf20a854
resulting in that breaking control knobs entirely.
Whoops.
The fix in ipn/ipnlocal (where it makes a new controlclient) but to
atone, I also added integration tests. Those integration tests use
a new "tailscale debug control-knobs" which by itself might be useful
for future debugging.
Updates #9351
Change-Id: Id9c89c8637746d879d5da67b9ac4e0d2367a3f0d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
| -rw-r--r-- | control/controlknobs/controlknobs.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go index ace56264c..dc24faac2 100644 --- a/control/controlknobs/controlknobs.go +++ b/control/controlknobs/controlknobs.go @@ -39,3 +39,19 @@ type Knobs struct { // running in magicsock, even when idle. ForceBackgroundSTUN atomic.Bool } + +// AsDebugJSON returns k as something that can be marshalled with json.Marshal +// for debug. +func (k *Knobs) AsDebugJSON() map[string]any { + if k == nil { + return nil + } + return map[string]any{ + "DisableUPnP": k.DisableUPnP.Load(), + "DisableDRPO": k.DisableDRPO.Load(), + "KeepFullWGConfig": k.KeepFullWGConfig.Load(), + "RandomizeClientPort": k.RandomizeClientPort.Load(), + "OneCGNAT": k.OneCGNAT.Load(), + "ForceBackgroundSTUN": k.ForceBackgroundSTUN.Load(), + } +} |
