Skip to content

Commit

Permalink
SMF Selection Fail Bug Fix (#348)
Browse files Browse the repository at this point in the history
* smf selection fail fix

Signed-off-by: AshithaCDAC <[email protected]>

* modified InSubscribedNssai function

Signed-off-by: AshithaCDAC <[email protected]>

---------

Signed-off-by: AshithaCDAC <[email protected]>
Co-authored-by: Ajay Lotan Thakur <[email protected]>
  • Loading branch information
ashithacdac and thakurajayL authored Dec 10, 2024
1 parent bf235a3 commit 61ae7ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion context/amf_ue.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,14 @@ func (ue *AmfUe) InAllowedNssai(targetSNssai models.Snssai, anType models.Access
return false
}

func (ue *AmfUe) InSubscribedNssai(targetSNssai models.Snssai) bool {
func (ue *AmfUe) InSubscribedNssai(targetSNssai *models.Snssai) bool {
for _, sNssai := range ue.SubscribedNssai {
if reflect.DeepEqual(*sNssai.SubscribedSnssai, targetSNssai) {
return true
} else if sNssai.SubscribedSnssai.Sst == targetSNssai.Sst {
logger.ContextLog.Info("SST values match, SD values differ")
targetSNssai.Sd = sNssai.SubscribedSnssai.Sd
return true
}
}
return false
Expand Down
2 changes: 1 addition & 1 deletion gmm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {

needSliceSelection := false
for _, requestedSnssai := range requestedNssai {
if ue.InSubscribedNssai(*requestedSnssai.ServingSnssai) {
if ue.InSubscribedNssai(requestedSnssai.ServingSnssai) {
allowedSnssai := models.AllowedSnssai{
AllowedSnssai: &models.Snssai{
Sst: requestedSnssai.ServingSnssai.Sst,
Expand Down

0 comments on commit 61ae7ec

Please sign in to comment.