cmd/cli: ignore un-usable interfaces on darwin when resetDNS

This commit is contained in:
Cuong Manh Le
2024-03-22 16:08:01 +07:00
committed by Cuong Manh Le
parent 64bcd2f00d
commit 87513cba6d
5 changed files with 28 additions and 1 deletions
+5
View File
@@ -67,6 +67,11 @@ func setDNS(iface *net.Interface, nameservers []string) error {
return nil
}
// resetDnsIgnoreUnusableInterface likes resetDNS, but return a nil error if the interface is not usable.
func resetDnsIgnoreUnusableInterface(iface *net.Interface) error {
return resetDNS(iface)
}
// TODO(cuonglm): should we use system API?
func resetDNS(iface *net.Interface) error {
resetDNSOnce.Do(func() {