diff --git a/Dockerfile b/Dockerfile index f65ce5208..9bbc4a916 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/loxinet/layer2.go b/loxinet/layer2.go index 234b39a60..5d15053be 100644 --- a/loxinet/layer2.go +++ b/loxinet/layer2.go @@ -76,6 +76,7 @@ type FdbEnt struct { stime time.Time unReach bool inActive bool + hCnt int Sync DpStatusT } @@ -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") } @@ -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