mirror of
https://github.com/tailscale/tailscale.git
synced 2026-07-20 21:23:07 +08:00
net/dns: add an envknob to force Linux DNS mode
Signed-off-by: Anton Tolchanov <anton@tailscale.com>
This commit is contained in:
parent
f0a1aa818f
commit
b9d49335f3
@ -15,6 +15,7 @@
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlknobs"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/health"
|
||||
@ -61,6 +62,8 @@ func (kv kv) String() string {
|
||||
optDBusReadString feature.Hook[func(name, objectPath, iface, member string) (string, error)]
|
||||
)
|
||||
|
||||
var forceMode = envknob.RegisterString("TS_DEBUG_LINUX_DNS_MODE")
|
||||
|
||||
// NewOSConfigurator created a new OS configurator.
|
||||
//
|
||||
// The health tracker may be nil; the knobs may be nil and are ignored on this platform.
|
||||
@ -139,6 +142,11 @@ func dnsMode(logf logger.Logf, health *health.Tracker, env newOSConfigEnv) (ret
|
||||
debug = append(debug, kv{k, v})
|
||||
}
|
||||
defer func() {
|
||||
if fm := forceMode(); fm != "" {
|
||||
dbg("forced", fm)
|
||||
dbg("detected", ret)
|
||||
ret = fm
|
||||
}
|
||||
if ret != "" {
|
||||
dbg("ret", ret)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user