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
2024-02-14 09:52:18 +07:00
committed by Cuong Manh Le
parent fdb82f6ec3
commit 583718f234
6 changed files with 14 additions and 31 deletions
-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
}