From 9d72595a337bf65b1ea957ae9cdaea39e5759c6f Mon Sep 17 00:00:00 2001 From: brianchennn Date: Mon, 27 Nov 2023 14:07:18 +0000 Subject: [PATCH] add error return after SendRerouteNasRequest, and fix typo --- internal/gmm/handler.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/gmm/handler.go b/internal/gmm/handler.go index 6f436989..58681b37 100644 --- a/internal/gmm/handler.go +++ b/internal/gmm/handler.go @@ -1171,12 +1171,12 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error { // Step 6 searchTargetAmfQueryParam := Nnrf_NFDiscovery.SearchNFInstancesParamOpts{} if ue.NetworkSliceInfo != nil { - netwotkSliceInfo := ue.NetworkSliceInfo - if netwotkSliceInfo.TargetAmfSet != "" { + networkSliceInfo := ue.NetworkSliceInfo + if networkSliceInfo.TargetAmfSet != "" { // TS 29.531 // TargetAmfSet format: ^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$ // mcc-mnc-amfRegionId(8 bit)-AmfSetId(10 bit) - targetAmfSetToken := strings.Split(netwotkSliceInfo.TargetAmfSet, "-") + targetAmfSetToken := strings.Split(networkSliceInfo.TargetAmfSet, "-") guami := amfSelf.ServedGuamiList[0] targetAmfPlmnId := models.PlmnId{ Mcc: targetAmfSetToken[0], @@ -1192,9 +1192,9 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error { searchTargetAmfQueryParam.AmfRegionId = optional.NewString(targetAmfSetToken[2]) searchTargetAmfQueryParam.AmfSetId = optional.NewString(targetAmfSetToken[3]) - } else if len(netwotkSliceInfo.CandidateAmfList) > 0 { + } else if len(networkSliceInfo.CandidateAmfList) > 0 { // TODO: select candidate Amf based on local poilcy - searchTargetAmfQueryParam.TargetNfInstanceId = optional.NewInterface(netwotkSliceInfo.CandidateAmfList[0]) + searchTargetAmfQueryParam.TargetNfInstanceId = optional.NewInterface(networkSliceInfo.CandidateAmfList[0]) } } @@ -1236,6 +1236,7 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error { // Condition (B) Step 7: initial AMF can not find Target AMF via NRF -> Send Reroute NAS Request to RAN allowedNssaiNgap := ngapConvert.AllowedNssaiToNgap(ue.AllowedNssai[anType]) ngap_message.SendRerouteNasRequest(ue, anType, nil, ue.RanUe[anType].InitialUEMessage, &allowedNssaiNgap) + return fmt.Errorf("target AMF not found") } return nil }