hotfix(routing): ignore non-main table for routes
- When searching for default routes - When searching for local networks
This commit is contained in:
@@ -31,6 +31,10 @@ func (r *Routing) DefaultRoutes() (defaultRoutes []DefaultRoute, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
|
if route.Table != 0 {
|
||||||
|
// ignore non-main table
|
||||||
|
continue
|
||||||
|
}
|
||||||
if route.Dst.IsValid() {
|
if route.Dst.IsValid() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ func (r *Routing) LocalNetworks() (localNetworks []LocalNetwork, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
if route.Gw.IsValid() || !route.Dst.IsValid() {
|
if route.Table != 0 || route.Gw.IsValid() || !route.Dst.IsValid() {
|
||||||
continue
|
continue
|
||||||
} else if _, ok := localLinks[route.LinkIndex]; !ok {
|
} else if _, ok := localLinks[route.LinkIndex]; !ok {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user