net/netmon: Do not iterate over problematic interfaces

Iterating interfaces happens unrelated to the previous problematic
interface check. Check here also to save time on initialization.

Updates #1552

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
pull/14575/head
Cezar Craciunoiu 11 months ago committed by Cezar Craciunoiu
parent 73128e2523
commit 599e84f194

@ -188,6 +188,9 @@ func ForeachInterface(fn func(Interface, []netip.Prefix)) error {
// the interface, and Bits are the subnet mask.
func (ifaces InterfaceList) ForeachInterface(fn func(Interface, []netip.Prefix)) error {
for _, iface := range ifaces {
if isProblematicInterface(iface.Interface) {
continue
}
addrs, err := iface.Addrs()
if err != nil {
return err

Loading…
Cancel
Save