diff options
| author | Andrea Gottardo <andrea@gottardo.me> | 2024-08-28 11:45:27 -0700 |
|---|---|---|
| committer | Andrea Gottardo <andrea@gottardo.me> | 2024-09-16 13:08:12 -0700 |
| commit | 72c9f0f8201d22cff9b1564097c5862cf5364400 (patch) | |
| tree | e62b5d27e9e0aa2199ce3fcbddc2e1a947e2ebca /control | |
| parent | 40833a752498206b0fe3cb076881343e4bb77dd9 (diff) | |
| download | tailscale-angott/captive-exit-node-disablement.tar.xz tailscale-angott/captive-exit-node-disablement.zip | |
ipnlocal: support automatic exit node disablement when captive portal detectedangott/captive-exit-node-disablement
Diffstat (limited to 'control')
| -rw-r--r-- | control/controlknobs/controlknobs.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go index dd76a3abd..043442162 100644 --- a/control/controlknobs/controlknobs.go +++ b/control/controlknobs/controlknobs.go @@ -103,6 +103,10 @@ type Knobs struct { // DisableCaptivePortalDetection is whether the node should not perform captive portal detection // automatically when the network state changes. DisableCaptivePortalDetection atomic.Bool + + // DisableExitNodeBehindCaptivePortal is whether the node should temporarily disable exit nodes + // whenever a captive portal is detected. + DisableExitNodeBehindCaptivePortal atomic.Bool } // UpdateFromNodeAttributes updates k (if non-nil) based on the provided self @@ -132,6 +136,7 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) { disableLocalDNSOverrideViaNRPT = has(tailcfg.NodeAttrDisableLocalDNSOverrideViaNRPT) disableCryptorouting = has(tailcfg.NodeAttrDisableMagicSockCryptoRouting) disableCaptivePortalDetection = has(tailcfg.NodeAttrDisableCaptivePortalDetection) + disableExitNodeBehindCaptivePortal = has(tailcfg.NodeAttrDisableExitNodeBehindCaptivePortal) ) if has(tailcfg.NodeAttrOneCGNATEnable) { @@ -159,6 +164,7 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) { k.DisableLocalDNSOverrideViaNRPT.Store(disableLocalDNSOverrideViaNRPT) k.DisableCryptorouting.Store(disableCryptorouting) k.DisableCaptivePortalDetection.Store(disableCaptivePortalDetection) + k.DisableExitNodeBehindCaptivePortal.Store(disableExitNodeBehindCaptivePortal) } // AsDebugJSON returns k as something that can be marshalled with json.Marshal @@ -187,5 +193,6 @@ func (k *Knobs) AsDebugJSON() map[string]any { "DisableLocalDNSOverrideViaNRPT": k.DisableLocalDNSOverrideViaNRPT.Load(), "DisableCryptorouting": k.DisableCryptorouting.Load(), "DisableCaptivePortalDetection": k.DisableCaptivePortalDetection.Load(), + "DisableExitNodeBehindCaptivePortal": k.DisableExitNodeBehindCaptivePortal.Load(), } } |
