refactor: inline
This eliminates the unnecessary indirection via interface names, instead identifying the interface by its index.
This commit is contained in:
1 parent
0caa9dd652
commit
b5256f7b71
2 files changed
+16
-17
No files matched your search
@@ -54,14 +54,3 @@ func forEachRoute(ignoreIfaceNames map[string]struct{}, check func(name string,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func CheckRouteExists(ifaceName string, dest net.IP) bool {
|
||||
found := false
|
||||
forEachRoute(map[string]struct{}{}, func(name string, route netlink.Route) error {
|
||||
if name == ifaceName && route.Dst.IP.Equal(dest) {
|
||||
found = true
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return found
|
||||
}
|
||||
Reference in new issue
Block a user