tailcfg: remove most Debug fields, move bulk to nodeAttrs [capver 70]
Now a nodeAttr: ForceBackgroundSTUN, DERPRoute, TrimWGConfig, DisableSubnetsIfPAC, DisableUPnP. Kept support for, but also now a NodeAttr: RandomizeClientPort. Removed: SetForceBackgroundSTUN, SetRandomizeClientPort (both never used, sadly... never got around to them. But nodeAttrs are better anyway), EnableSilentDisco (will be a nodeAttr later when that effort resumes). Updates #8923 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
e92adfe5e4
commit
25663b1307
@ -497,10 +497,7 @@ func forceFullWireguardConfig(numPeers int) bool {
|
||||
if b, ok := debugTrimWireguard().Get(); ok {
|
||||
return !b
|
||||
}
|
||||
if opt := controlclient.TrimWGConfig(); opt != "" {
|
||||
return !opt.EqualBool(true)
|
||||
}
|
||||
return false
|
||||
return controlclient.KeepFullWGConfig()
|
||||
}
|
||||
|
||||
// isTrimmablePeer reports whether p is a peer that we can trim out of the
|
||||
@ -795,7 +792,8 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, routerCfg *router.Config,
|
||||
e.mu.Unlock()
|
||||
|
||||
listenPort := e.confListenPort
|
||||
if debug != nil && debug.RandomizeClientPort {
|
||||
if controlclient.RandomizeClientPort() || // new way (capver 70)
|
||||
debug != nil && debug.RandomizeClientPort { // old way which server might still send (as of 2023-08-16)
|
||||
listenPort = 0
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user