actually ignore routes from other interfaces

This commit is contained in:
Vishvananda Ishaya 2015-08-17 17:37:46 -07:00
parent 01bbbda86c
commit b8d3e51d2a

View File

@ -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
}