From 412921fc1f69b39453aa3b3cdc08d3292884f545 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Thu, 8 Jun 2023 19:50:42 +0000 Subject: [PATCH] hotfix(routing): ignore non-main table for routes - When searching for default routes - When searching for local networks --- internal/routing/default.go | 4 ++++ internal/routing/local.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/routing/default.go b/internal/routing/default.go index 8ae77001..9ef88691 100644 --- a/internal/routing/default.go +++ b/internal/routing/default.go @@ -31,6 +31,10 @@ func (r *Routing) DefaultRoutes() (defaultRoutes []DefaultRoute, err error) { } for _, route := range routes { + if route.Table != 0 { + // ignore non-main table + continue + } if route.Dst.IsValid() { continue } diff --git a/internal/routing/local.go b/internal/routing/local.go index b9a5876c..93127420 100644 --- a/internal/routing/local.go +++ b/internal/routing/local.go @@ -47,7 +47,7 @@ func (r *Routing) LocalNetworks() (localNetworks []LocalNetwork, err error) { } for _, route := range routes { - if route.Gw.IsValid() || !route.Dst.IsValid() { + if route.Table != 0 || route.Gw.IsValid() || !route.Dst.IsValid() { continue } else if _, ok := localLinks[route.LinkIndex]; !ok { continue