hotfix(routing): change main table from 0 to 254

This commit is contained in:
Quentin McGaw
2023-06-08 20:03:07 +00:00
parent 412921fc1f
commit 4675572328
2 changed files with 5 additions and 2 deletions

View File

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

View File

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