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

fix: UPF Duplicate URR error #119

Closed
wants to merge 2 commits into from
Closed
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
28 changes: 24 additions & 4 deletions internal/context/datapath.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ func (node *DataPathNode) DeactivateUpLinkTunnel(smContext *SMContext) {
if far := pdr.FAR; far != nil {
err = node.UPF.RemoveFAR(far)
if err != nil {
logger.CtxLog.Warnln("Deactivated UpLinkTunnel", err)
logger.CtxLog.Warnln("Deactivated UpLinkTunnel RemoveFAR", err)
}

bar := far.BAR
if bar != nil {
err = node.UPF.RemoveBAR(bar)
if err != nil {
logger.CtxLog.Warnln("Deactivated UpLinkTunnel", err)
logger.CtxLog.Warnln("Deactivated UpLinkTunnel RemoveBAR", err)
}
}
}
Expand All @@ -201,7 +201,17 @@ func (node *DataPathNode) DeactivateUpLinkTunnel(smContext *SMContext) {
if qer != nil {
err = node.UPF.RemoveQER(qer)
if err != nil {
logger.CtxLog.Warnln("Deactivated UpLinkTunnel", err)
logger.CtxLog.Warnln("Deactivated UpLinkTunnel RemoveQER", err)
}
}
}
}

if urrList := pdr.URR; urrList != nil {
for _, urr := range urrList {
if urr != nil {
if err = node.UPF.RemoveURR(urr); err != nil {
logger.CtxLog.Warnln("Deactivated UpLinkTunnel RemoveURR:", err)
}
}
}
Expand Down Expand Up @@ -236,7 +246,17 @@ func (node *DataPathNode) DeactivateDownLinkTunnel(smContext *SMContext) {
if qer != nil {
err = node.UPF.RemoveQER(qer)
if err != nil {
logger.CtxLog.Warnln("Deactivated UpLinkTunnel", err)
logger.CtxLog.Warnln("Deactivated DownLinkTunnel", err)
}
}
}
}

if urrList := pdr.URR; urrList != nil {
for _, urr := range urrList {
if urr != nil {
if err = node.UPF.RemoveURR(urr); err != nil {
logger.CtxLog.Warnln("Deactivated DownLinkTunnel RemoveURR:", err)
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions internal/context/upf.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,18 @@ func (upf *UPF) RemoveQER(qer *QER) (err error) {
return nil
}

// TODO: add unit test
func (upf *UPF) RemoveURR(urr *URR) (err error) {
if upf.UPFStatus != AssociatedSetUpSuccess {
err = fmt.Errorf("UPF[%s] not Associate with SMF", upf.NodeID.ResolveNodeIdToIp().String())
return err
}

upf.urrIDGenerator.FreeID(int64(urr.URRID))
upf.urrPool.Delete(urr.URRID)
return nil
}

func (upf *UPF) isSupportSnssai(snssai *SNssai) bool {
for _, snssaiInfo := range upf.SNssaiInfos {
if snssaiInfo.SNssai.Equal(snssai) {
Expand Down
Loading