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:
Cuong Manh Le
2024-09-20 21:33:44 +07:00
committed by Cuong Manh Le
parent 8c661c4401
commit 5a88a7c22c
5 changed files with 106 additions and 74 deletions
+1
View File
@@ -119,6 +119,7 @@ func resetDNS(iface *net.Interface) error {
if len(ns) == 0 {
continue
}
mainLog.Load().Debug().Msgf("setting static DNS for interface %q", iface.Name)
if err := setDNS(iface, ns); err != nil {
return err
}