mirror of
https://github.com/vishvananda/netlink
synced 2025-02-19 21:56:57 +00:00
actually ignore routes from other interfaces
This commit is contained in:
parent
01bbbda86c
commit
b8d3e51d2a
@ -119,6 +119,7 @@ func RouteList(link Link, family int) ([]Route, error) {
|
||||
|
||||
native := nl.NativeEndian()
|
||||
var res []Route
|
||||
MsgLoop:
|
||||
for _, m := range msgs {
|
||||
msg := nl.DeserializeRtMsg(m)
|
||||
|
||||
@ -153,7 +154,7 @@ func RouteList(link Link, family int) ([]Route, error) {
|
||||
routeIndex := int(native.Uint32(attr.Value[0:4]))
|
||||
if link != nil && routeIndex != index {
|
||||
// Ignore routes from other interfaces
|
||||
continue
|
||||
continue MsgLoop
|
||||
}
|
||||
route.LinkIndex = routeIndex
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user