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

This commit is contained in:
Cuong Manh Le
2024-03-12 19:01:31 +07:00
committed by Cuong Manh Le
parent 64bcd2f00d
commit 87513cba6d
5 changed files with 28 additions and 1 deletions
+5
View File
@@ -119,6 +119,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)
}
func resetDNS(iface *net.Interface) (err error) {
defer func() {
if err == nil {