mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
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.
This commit is contained in:
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user