Skip to content

Commit

Permalink
Merge pull request #500 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
gh-494 Fixes for ipvs-compat mode
  • Loading branch information
UltraInstinct14 authored Jan 20, 2024
2 parents c458b44 + 7c3977a commit da37464
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM ubuntu:20.04

# LABEL about the loxilb image
LABEL description="This is loxilb official Docker Image"
LABEL description="loxilb official docker image"

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
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 da37464

Please sign in to comment.