cmd/cli: new flow for leaking queries to OS resolver

The current flow involves marking OS resolver as down, which is not
right at all, since ctrld depends on it for leaking queries.

This commits implements new flow, which ctrld will restore DNS settings
once leaking marked, allowing queries go to OS resolver until the
internet connection is established.
This commit is contained in:
Cuong Manh Le
2025-01-15 19:51:55 +07:00
committed by Cuong Manh Le
parent f986a575e8
commit 89600f6091
4 changed files with 20 additions and 29 deletions
+1 -1
View File
@@ -729,7 +729,7 @@ func (p *prog) dnsWatchdog(iface *net.Interface, nameservers []string, allIfaces
mainLog.Load().Debug().Msg("stop dns watchdog")
return
case <-ticker.C:
if p.leakingQuery.Load() || p.um.isChecking(upstreamOS) {
if p.leakingQuery.Load() {
return
}
if dnsChanged(iface, ns) {