Skip to content

Commit

Permalink
Merge pull request #942 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
#921 Do not handle custom rt-tables
  • Loading branch information
UltraInstinct14 authored Jan 22, 2025
2 parents 9580db7 + 07f5c3d commit 2adf4da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions api/loxinlp/nlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,11 @@ func DelNeigh(neigh nlp.Neigh, link nlp.Link) int {

func AddRoute(route nlp.Route) int {
var ipNet net.IPNet

if route.Table < 254 {
return -1
}

if route.Dst == nil {
if route.Family == 2 {
r := net.IPv4(0, 0, 0, 0)
Expand Down Expand Up @@ -1293,6 +1298,9 @@ func GetRouteNoHook(destination string) ([]string, string, error) {
}

for _, rt := range rts {
if rt.Table < 254 {
continue
}
if src == "" {
src = rt.Src.String()
}
Expand Down Expand Up @@ -1320,6 +1328,11 @@ func DelRouteNoHook(DestinationIPNet string) int {
func DelRoute(route nlp.Route) int {
var ret int
var ipNet net.IPNet

if route.Table < 254 {
return -1
}

if route.Dst == nil {
r := net.IPv4(0, 0, 0, 0)
m := net.CIDRMask(0, 32)
Expand Down

0 comments on commit 2adf4da

Please sign in to comment.