cmd/cli: always run dns watchdog on Darwin/Windows

This commit is contained in:
Cuong Manh Le
2024-07-24 14:02:30 +07:00
committed by Cuong Manh Le
parent 9ddedf926e
commit 72bf80533e

View File

@@ -538,14 +538,10 @@ func (p *prog) setDNS() {
// dnsWatchdog watches for DNS changes on Darwin and Windows then re-applying ctrld's settings.
// This is only works when deactivation pin set.
func (p *prog) dnsWatchdog(iface *net.Interface, nameservers []string, allIfaces bool) {
switch runtime.GOOS {
case "darwin", "windows":
default:
return
}
if deactivationPinNotSet() {
if !requiredMultiNICsConfig() {
return
}
p.dnsWatchDogOnce.Do(func() {
mainLog.Load().Debug().Msg("start DNS settings watchdog")
ns := nameservers