Skip to content

Commit

Permalink
loxilb-io#921 Initial support for dport range LB rules
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Jan 19, 2025
1 parent 270843d commit 12e7021
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const (

// constants
const (
MaxLBEndPoints = 32
MaxLBEndPoints = 32 // Max number of supported LB end-points
DflLbaInactiveTries = 2 // Default number of inactive tries before LB arm is turned off
MaxDflLbaInactiveTries = 100 // Max number of inactive tries before LB arm is turned off
DflLbaCheckTimeout = 10 // Default timeout for checking LB arms
Expand All @@ -96,6 +96,7 @@ const (
NatFwMark = 0x80000000 // NAT Marker
SrcChkFwMark = 0x40000000 // Src check Marker
OnDfltSnatFwMark = 0x20000000 // Ondefault Snat Marker
MaxSrcLBMarkerNum = 28 // Max LB indexes which support source checks
)

type ruleTType uint
Expand Down Expand Up @@ -1075,7 +1076,7 @@ func (R *RuleH) addAllowedLbSrc(CIDR string, lbMark uint32) *allowedSrcElem {
return nil
}

if lbMark >= 30 {
if lbMark > MaxSrcLBMarkerNum {
tk.LogIt(tk.LogError, "allowed-src lbmark out-of-range\n")
return nil
}
Expand Down Expand Up @@ -1126,7 +1127,7 @@ func (R *RuleH) deleteAllowedLbSrc(CIDR string, lbMark uint32) error {
return errors.New("no such allowed src prefix")
}

if lbMark >= 30 {
if lbMark > MaxSrcLBMarkerNum {
tk.LogIt(tk.LogError, "allowed-src lbmark out-of-range\n")
return nil
}
Expand Down

0 comments on commit 12e7021

Please sign in to comment.