hotfix(routing): change main table from 0 to 254
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/netip"
|
"net/netip"
|
||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/netlink"
|
"github.com/qdm12/gluetun/internal/netlink"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -31,7 +32,8 @@ func (r *Routing) DefaultRoutes() (defaultRoutes []DefaultRoute, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, route := range routes {
|
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
|
// ignore non-main table
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/netip"
|
"net/netip"
|
||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/netlink"
|
"github.com/qdm12/gluetun/internal/netlink"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -47,7 +48,7 @@ func (r *Routing) LocalNetworks() (localNetworks []LocalNetwork, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, route := range routes {
|
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
|
continue
|
||||||
} else if _, ok := localLinks[route.LinkIndex]; !ok {
|
} else if _, ok := localLinks[route.LinkIndex]; !ok {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user