From e8d3ed1acd1b39de3da82274095390b5173bff53 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 6 Aug 2024 00:17:17 +0700 Subject: [PATCH] cmd/cli: use currentStaticDNS when checking DNS changed The dns watchdog is spawned *after* DNS was set by ctrld, thus it should use the currentStaticDNS for getting the static DNS, instead of relying on currentDNS, which could be system wide instead of per interfaces. --- cmd/cli/prog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cli/prog.go b/cmd/cli/prog.go index c112ada..f9b9f06 100644 --- a/cmd/cli/prog.go +++ b/cmd/cli/prog.go @@ -956,7 +956,7 @@ func savedStaticNameservers(iface *net.Interface) []string { // dnsChanged reports whether DNS settings for given interface was changed. // The caller must sort the nameservers before calling this function. func dnsChanged(iface *net.Interface, nameservers []string) bool { - curNameservers := currentDNS(iface) + curNameservers, _ := currentStaticDNS(iface) slices.Sort(curNameservers) return !slices.Equal(curNameservers, nameservers) }