Skip to content

Commit

Permalink
gh-494 Fixes for ipvs-compat mode
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Jan 20, 2024
1 parent 20031cb commit 7c3977a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions loxinet/layer2.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type FdbEnt struct {
stime time.Time
unReach bool
inActive bool
hCnt int
Sync DpStatusT
}

Expand Down Expand Up @@ -200,6 +201,10 @@ func (l2 *L2H) L2FdbAdd(key FdbKey, attr FdbAttr) (int, error) {
if found == true {
// Check if it is a modify
if l2FdbAttrEqual(&attr, &fdb.FdbAttr) {
if attr.FdbType == cmn.FdbPhy {
fdb.hCnt++
return 0, nil
}
tk.LogIt(tk.LogDebug, "fdb ent exists, %v\n", key)
return L2SameFdbErr, errors.New("same fdb")
}
Expand Down Expand Up @@ -242,6 +247,13 @@ func (l2 *L2H) L2FdbDel(key FdbKey) (int, error) {
return L2NoFdbErr, errors.New("no such fdb")
}

if fdb.FdbAttr.FdbType == cmn.FdbPhy {
if fdb.hCnt > 0 {
fdb.hCnt--
return 0, nil
}
}

if fdb.Port.SInfo.PortType == cmn.PortVxlanBr {
// Remove route dependencies if any
n := 0
Expand Down

0 comments on commit 7c3977a

Please sign in to comment.