cmd/cli: silent un-necessary error for physical interfaces loop

The loop is run after the main interface DNS was set, thus the error
would make noise to users. This commit removes the noise, by making
currentStaticDNS returns an additional error, so it's up to the caller
to decive whether to emit the error or not.

Further, the physical interface loop will now only log when the callback
function runs successfully. Emitting the callback error can be done in
the future, until we can figure out how to detect physical interfaces in
Go portably.
This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2024-02-19 18:29:22 +07:00
1 parent fdb82f6ec3
commit 583718f234
6 files changed
+14 -31

No files matched your search

-5
View File
@@ -2223,8 +2223,3 @@ func absHomeDir(filename string) string {
}
return filepath.Join(dir, filename)
}
// ifaceUp reports whether the net interface is up.
func ifaceUp(iface *net.Interface) bool {
return iface != nil && iface.Flags&net.FlagUp != 0
}