summaryrefslogtreecommitdiffhomepage
path: root/control/controlknobs
diff options
context:
space:
mode:
authorClaire Wang <claire@tailscale.com>2024-03-25 12:50:21 -0400
committerClaire Wang <claire@tailscale.com>2024-03-25 12:50:21 -0400
commite365124313daa84997f781743b9f67592bc0e199 (patch)
tree6425889a3a3f6a618a662630627fa363dcfe5ac9 /control/controlknobs
parenta36cfb4d3dba655c7c718f39d4c9b3a9d1e8df39 (diff)
downloadtailscale-clairew/log-dst-exit-node.tar.xz
tailscale-clairew/log-dst-exit-node.zip
wgenging/logger: add log control knobclairew/log-dst-exit-node
updates tailscale/corp#18625
Diffstat (limited to 'control/controlknobs')
-rw-r--r--control/controlknobs/controlknobs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go
index 6e3a62967..bea8bfd19 100644
--- a/control/controlknobs/controlknobs.go
+++ b/control/controlknobs/controlknobs.go
@@ -72,6 +72,9 @@ type Knobs struct {
// ProbeUDPLifetime is whether the node should probe UDP path lifetime on
// the tail end of an active direct connection in magicsock.
ProbeUDPLifetime atomic.Bool
+
+ // NetworkFlowLoggingDstEnable is whether network flow logging on destinations for exit nodes is enabled.
+ NetworkFlowLoggingDstEnable atomic.Bool
}
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
@@ -96,6 +99,7 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
forceNfTables = has(tailcfg.NodeAttrLinuxMustUseNfTables)
seamlessKeyRenewal = has(tailcfg.NodeAttrSeamlessKeyRenewal)
probeUDPLifetime = has(tailcfg.NodeAttrProbeUDPLifetime)
+ networkFlowLoggingDstEnable = has(tailcfg.NodeAttrNetworkFlowLoggingDst)
)
if has(tailcfg.NodeAttrOneCGNATEnable) {
@@ -118,6 +122,7 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
k.LinuxForceNfTables.Store(forceNfTables)
k.SeamlessKeyRenewal.Store(seamlessKeyRenewal)
k.ProbeUDPLifetime.Store(probeUDPLifetime)
+ k.NetworkFlowLoggingDstEnable.Store(networkFlowLoggingDstEnable)
}
// AsDebugJSON returns k as something that can be marshalled with json.Marshal
@@ -141,5 +146,6 @@ func (k *Knobs) AsDebugJSON() map[string]any {
"LinuxForceNfTables": k.LinuxForceNfTables.Load(),
"SeamlessKeyRenewal": k.SeamlessKeyRenewal.Load(),
"ProbeUDPLifetime": k.ProbeUDPLifetime.Load(),
+ "NewtorkFlowLoggingDstEnable": k.NetworkFlowLoggingDstEnable.Load(),
}
}