hotfix(routing): change main table from 0 to 254
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user