Skip to content

Commit

Permalink
fix: target AMF should not be self
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon777-coder committed Nov 22, 2023
1 parent b8e8da1 commit 5a699f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/gmm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1120,12 +1120,19 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {
needSliceSelection = true
break
}
reqSnssai := models.Snssai{

reqSnssai := models.Snssai {
Sst: requestedSnssai.ServingSnssai.Sst,
Sd: requestedSnssai.ServingSnssai.Sd,
}

if !amfSelf.InPlmnSupportList(reqSnssai) {
needSliceSelection = true
break
}

}

if !amfSelf.InPlmnSupportList(reqSnssai) {
needSliceSelection = true
break

Check failure on line 1138 in internal/gmm/handler.go

View workflow job for this annotation

GitHub Actions / Go 1.18 sample

break is not in a loop, switch, or select
Expand Down
3 changes: 3 additions & 0 deletions internal/sbi/consumer/nf_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func SearchAmfCommunicationInstance(ue *amf_context.AmfUe, nrfUri string, target
// select the first AMF, TODO: select base on other info
var amfUri string
for _, nfProfile := range resp.NfInstances {
if nfProfile.NfInstanceId == amf_context.GetSelf().NfId {
continue
}
ue.TargetAmfProfile = &nfProfile
amfUri = util.SearchNFServiceUri(nfProfile, models.ServiceName_NAMF_COMM, models.NfServiceStatus_REGISTERED)
if amfUri != "" {
Expand Down

0 comments on commit 5a699f7

Please sign in to comment.