Skip to content

Commit

Permalink
Merge pull request #432 from cybwan/fix-issue2
Browse files Browse the repository at this point in the history
fix base error's value
  • Loading branch information
UltraInstinct14 authored Nov 6, 2023
2 parents 321a547 + 9b93bec commit 7b0cca6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
9 changes: 5 additions & 4 deletions loxinet/dpbroker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (
"sync"
"time"

cmn "github.com/loxilb-io/loxilb/common"
tk "github.com/loxilb-io/loxilib"

cmn "github.com/loxilb-io/loxilb/common"
)

// man names constants
Expand All @@ -43,7 +44,7 @@ const (

// error codes
const (
DpErrBase = iota - L3ErrBase - 1000
DpErrBase = iota - 103000
DpWqUnkErr
)

Expand Down Expand Up @@ -311,7 +312,7 @@ type DpCtInfo struct {
ServProto string `json:"servproto"`
L4ServPort uint16 `json:"l4servproto"`
BlockNum uint16 `json:"blocknum"`
RuleID uint32 `json:"ruleid"`
RuleID uint32 `json:"ruleid"`
}

const (
Expand Down Expand Up @@ -817,7 +818,7 @@ func (dp *DpH) DpMapGetCt4() []cmn.CtInfo {
switch r := ret.(type) {
case map[string]*DpCtInfo:
for _, dCti := range r {

mh.mtx.Lock()
rule := mh.zr.Rules.GetNatLbRuleByID(dCti.RuleID)
mh.mtx.Unlock()
Expand Down
5 changes: 3 additions & 2 deletions loxinet/layer3.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import (
"fmt"
"net"

cmn "github.com/loxilb-io/loxilb/common"
tk "github.com/loxilb-io/loxilib"

cmn "github.com/loxilb-io/loxilb/common"
)

// constants
const (
L3ErrBase = iota - RtErrBase - 1000
L3ErrBase = iota - 8000
L3AddrErr
L3ObjErr
)
Expand Down
4 changes: 2 additions & 2 deletions loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (

// error codes
const (
RuleErrBase = iota - ZoneBaseErr - 1000
RuleErrBase = iota - 7000
RuleUnknownServiceErr
RuleUnknownEpErr
RuleExistsErr
Expand Down Expand Up @@ -272,7 +272,7 @@ type ruleEnt struct {
act ruleAct
secIP []ruleNatSIP
stat ruleStat
name string
name string
}

type ruleTable struct {
Expand Down
5 changes: 3 additions & 2 deletions loxinet/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import (
"fmt"
"net"

cmn "github.com/loxilb-io/loxilb/common"
tk "github.com/loxilb-io/loxilib"

cmn "github.com/loxilb-io/loxilb/common"
)

// error codes for session api
const (
SessErrBase = iota - 90000
SessErrBase = iota - 102000
SessModErr
SessNoExistErr
SessExistsErr
Expand Down
2 changes: 1 addition & 1 deletion loxinet/zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

// error codes for zone
const (
ZoneBaseErr = iota - RtErrBase - 1000
ZoneBaseErr = iota - 6000
ZoneExistsErr
ZoneNotExistErr
ZoneNumberErr
Expand Down

0 comments on commit 7b0cca6

Please sign in to comment.