@ -95,6 +95,10 @@ type Knobs struct {
// We began creating this rule on 2024-06-14, and this knob
// We began creating this rule on 2024-06-14, and this knob
// allows us to disable the new behavior remotely if needed.
// allows us to disable the new behavior remotely if needed.
DisableLocalDNSOverrideViaNRPT atomic . Bool
DisableLocalDNSOverrideViaNRPT atomic . Bool
// DisableCryptorouting indicates that the node should not use the
// magicsock crypto routing feature.
DisableCryptorouting atomic . Bool
}
}
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
@ -122,6 +126,7 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
userDialUseRoutes = has ( tailcfg . NodeAttrUserDialUseRoutes )
userDialUseRoutes = has ( tailcfg . NodeAttrUserDialUseRoutes )
disableSplitDNSWhenNoCustomResolvers = has ( tailcfg . NodeAttrDisableSplitDNSWhenNoCustomResolvers )
disableSplitDNSWhenNoCustomResolvers = has ( tailcfg . NodeAttrDisableSplitDNSWhenNoCustomResolvers )
disableLocalDNSOverrideViaNRPT = has ( tailcfg . NodeAttrDisableLocalDNSOverrideViaNRPT )
disableLocalDNSOverrideViaNRPT = has ( tailcfg . NodeAttrDisableLocalDNSOverrideViaNRPT )
disableCryptorouting = has ( tailcfg . NodeAttrDisableMagicSockCryptoRouting )
)
)
if has ( tailcfg . NodeAttrOneCGNATEnable ) {
if has ( tailcfg . NodeAttrOneCGNATEnable ) {
@ -147,6 +152,7 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
k . UserDialUseRoutes . Store ( userDialUseRoutes )
k . UserDialUseRoutes . Store ( userDialUseRoutes )
k . DisableSplitDNSWhenNoCustomResolvers . Store ( disableSplitDNSWhenNoCustomResolvers )
k . DisableSplitDNSWhenNoCustomResolvers . Store ( disableSplitDNSWhenNoCustomResolvers )
k . DisableLocalDNSOverrideViaNRPT . Store ( disableLocalDNSOverrideViaNRPT )
k . DisableLocalDNSOverrideViaNRPT . Store ( disableLocalDNSOverrideViaNRPT )
k . DisableCryptorouting . Store ( disableCryptorouting )
}
}
// AsDebugJSON returns k as something that can be marshalled with json.Marshal
// AsDebugJSON returns k as something that can be marshalled with json.Marshal
@ -173,5 +179,6 @@ func (k *Knobs) AsDebugJSON() map[string]any {
"UserDialUseRoutes" : k . UserDialUseRoutes . Load ( ) ,
"UserDialUseRoutes" : k . UserDialUseRoutes . Load ( ) ,
"DisableSplitDNSWhenNoCustomResolvers" : k . DisableSplitDNSWhenNoCustomResolvers . Load ( ) ,
"DisableSplitDNSWhenNoCustomResolvers" : k . DisableSplitDNSWhenNoCustomResolvers . Load ( ) ,
"DisableLocalDNSOverrideViaNRPT" : k . DisableLocalDNSOverrideViaNRPT . Load ( ) ,
"DisableLocalDNSOverrideViaNRPT" : k . DisableLocalDNSOverrideViaNRPT . Load ( ) ,
"DisableCryptorouting" : k . DisableCryptorouting . Load ( ) ,
}
}
}
}