Skip to content

Commit

Permalink
Merge pull request #533 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR - Filter onlink subnets
  • Loading branch information
UltraInstinct14 authored Feb 19, 2024
2 parents f0d8cf1 + f44e7cc commit f571a83
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/loxinlp/nlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,10 @@ func RUWorkSingle(m nlp.RouteUpdate) int {
return -1
}

if m.Route.Scope.String() == "link" && tk.IsNetIPv4(m.Dst.IP.String()) {
return -1
}

if m.Type == syscall.RTM_NEWROUTE {
ret = AddRoute(m.Route)
} else {
Expand Down Expand Up @@ -1525,6 +1529,10 @@ func NlpGet(ch chan bool) int {
tk.LogIt(tk.LogDebug, "[NLP] No STATIC routes found for intf %s\n", link.Attrs().Name)
} else {
for _, route := range routes {
if route.Scope.String() == "link" && tk.IsNetIPv4(route.Dst.IP.String()) {
continue
}

AddRoute(route)
}
}
Expand Down

0 comments on commit f571a83

Please sign in to comment.