Skip to content

Commit

Permalink
- Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimkurb committed Jan 4, 2025
1 parent d5892c2 commit 08955c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_VERSION:=1.0.1
PKG_VERSION:=1.2.0
PKG_RELEASE:=1
PKG_FULLVERSION:=$(PKG_VERSION)-$(PKG_RELEASE)

Expand Down
7 changes: 4 additions & 3 deletions lib/networking/iproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/networking/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 08955c9

Please sign in to comment.