diff --git a/internal/context/datapath.go b/internal/context/datapath.go index 3b540813..66780904 100644 --- a/internal/context/datapath.go +++ b/internal/context/datapath.go @@ -831,7 +831,7 @@ func (p *DataPath) AddChargingRules(smContext *SMContext, chgLevel ChargingLevel // nolint nodeId, _ := node.GetUPFID() logger.PduSessLog.Tracef("DownLinkTunnel add URR for node %s %+v", - nodeId, node.UpLinkTunnel.PDR) + nodeId, node.DownLinkTunnel.PDR) } } } diff --git a/internal/context/user_plane_information.go b/internal/context/user_plane_information.go index 5204399b..1978ba10 100644 --- a/internal/context/user_plane_information.go +++ b/internal/context/user_plane_information.go @@ -741,14 +741,10 @@ func (upi *UserPlaneInformation) selectMatchUPF(selection *UPFSelectionParams) [ if currentSnssai.Equal(targetSnssai) { for _, dnnInfo := range snssaiInfo.DnnList { - if dnnInfo.Dnn != selection.Dnn { - continue + if dnnInfo.Dnn == selection.Dnn && dnnInfo.ContainsDNAI(selection.Dnai) { + upList = append(upList, upNode) + break } - if selection.Dnai != "" && !dnnInfo.ContainsDNAI(selection.Dnai) { - continue - } - upList = append(upList, upNode) - break } } } diff --git a/internal/pfcp/message/build.go b/internal/pfcp/message/build.go index 5a81fd80..d20af340 100644 --- a/internal/pfcp/message/build.go +++ b/internal/pfcp/message/build.go @@ -435,8 +435,9 @@ func BuildPfcpSessionEstablishmentRequest( urrMap[urr.URRID] = urr } for _, filteredURR := range urrMap { - if filteredURR.State == context.RULE_INITIAL { - msg.CreateURR = append(msg.CreateURR, urrToCreateURR(filteredURR)) + msg.CreateURR = append(msg.CreateURR, urrToCreateURR(filteredURR)) + if filteredURR.State == context.RULE_CREATE { + smContext.Log.Warn("Duplicate URR creation") } filteredURR.State = context.RULE_CREATE } @@ -564,6 +565,9 @@ func BuildPfcpSessionModificationRequest( for _, urr := range urrList { switch urr.State { + case context.RULE_CREATE: + smContext.Log.Warn("Duplicate URR creation") + fallthrough case context.RULE_INITIAL: msg.CreateURR = append(msg.CreateURR, urrToCreateURR(urr)) case context.RULE_UPDATE: