From 46755723285740bd73875df16dff28a12ecde379 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Thu, 8 Jun 2023 20:03:07 +0000 Subject: [PATCH] hotfix(routing): change main table from `0` to `254` --- internal/routing/default.go | 4 +++- internal/routing/local.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/routing/default.go b/internal/routing/default.go index 9ef88691..4bb5fa18 100644 --- a/internal/routing/default.go +++ b/internal/routing/default.go @@ -6,6 +6,7 @@ import ( "net/netip" "github.com/qdm12/gluetun/internal/netlink" + "golang.org/x/sys/unix" ) var ( @@ -31,7 +32,8 @@ func (r *Routing) DefaultRoutes() (defaultRoutes []DefaultRoute, err error) { } for _, route := range routes { - if route.Table != 0 { + fmt.Println("route.table", route.Table) + if route.Table != unix.RT_TABLE_MAIN { // ignore non-main table continue } diff --git a/internal/routing/local.go b/internal/routing/local.go index 93127420..0b7ba84d 100644 --- a/internal/routing/local.go +++ b/internal/routing/local.go @@ -6,6 +6,7 @@ import ( "net/netip" "github.com/qdm12/gluetun/internal/netlink" + "golang.org/x/sys/unix" ) var ( @@ -47,7 +48,7 @@ func (r *Routing) LocalNetworks() (localNetworks []LocalNetwork, err error) { } for _, route := range routes { - if route.Table != 0 || route.Gw.IsValid() || !route.Dst.IsValid() { + if route.Table != unix.RT_TABLE_MAIN || route.Gw.IsValid() || !route.Dst.IsValid() { continue } else if _, ok := localLinks[route.LinkIndex]; !ok { continue