refactor: inline

This eliminates the unnecessary indirection via interface names,
instead identifying the interface by its index.
This commit is contained in:
Matthias Radestock committed 2016-01-19 16:36:16 +00:00
1 parent 0caa9dd652
commit b5256f7b71
2 files changed
+16 -17

No files matched your search

-11
View File
@@ -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
}