Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-494 Fixes for ipvs-compat mode #500

Merged
merged 2 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading