mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
cmd/cli: decouple reset DNS task from ctrld status
So it can be run regardless of ctrld current status. This prevents a racy behavior when reset DNS task restores DNS settings of the system, but current running ctrld process may revert it immediately.
This commit is contained in:
committed by
Cuong Manh Le
parent
8c661c4401
commit
5a88a7c22c
@@ -915,6 +915,8 @@ func (p *prog) performCaptivePortalDetection() {
|
||||
if found {
|
||||
resetDnsOnce.Do(func() {
|
||||
mainLog.Load().Warn().Msg("found captive portal, leaking query to OS resolver")
|
||||
// Store the result once here, so changes made below won't be reverted by DNS watchers.
|
||||
p.captivePortalDetected.Store(found)
|
||||
p.resetDNS()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user