diff --git a/Makefile b/Makefile index ef332b6..1679870 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PKG_VERSION:=1.0.1 +PKG_VERSION:=1.2.0 PKG_RELEASE:=1 PKG_FULLVERSION:=$(PKG_VERSION)-$(PKG_RELEASE) diff --git a/lib/networking/iproute.go b/lib/networking/iproute.go index 83dafc1..a828fd4 100644 --- a/lib/networking/iproute.go +++ b/lib/networking/iproute.go @@ -36,8 +36,8 @@ func (r *IpRoute) String() string { } } - return fmt.Sprintf("table %d: src=%s dst=%s -> dev %s (idx=%d)", - r.Table, from, to, linkName, r.LinkIndex) + return fmt.Sprintf("table %d: src=%s dst=%s -> dev %s (idx=%d) [metric:%d]", + r.Table, from, to, linkName, r.LinkIndex, r.Priority) } func BuildDefaultRoute(ipFamily config.IpFamily, iface Interface, table int) *IpRoute { @@ -167,7 +167,8 @@ func ListRoutesInTable(table int) ([]*IpRoute, error) { var ipRoutes []*IpRoute for _, route := range routes { - ipRoutes = append(ipRoutes, &IpRoute{&route}) + copiedRoute := route + ipRoutes = append(ipRoutes, &IpRoute{&copiedRoute}) } return ipRoutes, nil diff --git a/lib/networking/network.go b/lib/networking/network.go index 7ec56c6..f0357c3 100644 --- a/lib/networking/network.go +++ b/lib/networking/network.go @@ -72,7 +72,7 @@ func applyIpsetNetworkConfiguration(ipset *config.IpsetConfig, useKeeneticAPI bo } else { // Cleanup all routes (except blackhole route if kill switch is enabled) for _, route := range routes { - if ipset.Routing.KillSwitch && route.Type&unix.NHA_BLACKHOLE != 0 { + if ipset.Routing.KillSwitch && route.Type&unix.RTN_BLACKHOLE != 0 { blackholePresent = true continue }