1 parent
c391092ea6
commit
0caa9dd652
2 files changed
+8
-7
No files matched your search
@@ -57,8 +57,7 @@ func EnsureInterfaceAndMcastRoute(ifaceName string) (*net.Interface, error) {
|
||||
return iface, err
|
||||
}
|
||||
for update := range ch {
|
||||
link, _ := netlink.LinkByIndex(update.Route.LinkIndex)
|
||||
if link.Attrs().Name == ifaceName && update.Route.Dst.IP.Equal(dest) {
|
||||
if update.Route.LinkIndex == iface.Index && update.Route.Dst.IP.Equal(dest) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -41,12 +41,14 @@ func forEachRoute(ignoreIfaceNames map[string]struct{}, check func(name string,
|
||||
}
|
||||
for _, route := range routes {
|
||||
link, err := netlink.LinkByIndex(route.LinkIndex)
|
||||
if err == nil {
|
||||
if _, found := ignoreIfaceNames[link.Attrs().Name]; found {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if err := check(link.Attrs().Name, route); err != nil {
|
||||
ifaceName := link.Attrs().Name
|
||||
if _, found := ignoreIfaceNames[ifaceName]; found {
|
||||
continue
|
||||
}
|
||||
if err := check(ifaceName, route); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user