fix: set RatType correctly during registration#685
Closed
donivtech wants to merge 1 commit into
Closed
Conversation
During normal registration ue.RatType was never set: the only code path that assigned it was CreateUEContextProcedure, and it copied RestrictedRatList[0] — a list of RAT types the UE is *not* allowed to use — which is semantically wrong and also panics when the list is empty (minItem = -1 per spec). Set ue.RatType from the access type in HandleRegistrationRequest instead: - 3GPP access with NrLocation -> NR - 3GPP access with EutraLocation -> EUTRA - Non-3GPP access -> WLAN Remove the buggy RestrictedRatList[0] assignment in producer/ue_context.go. This makes RatType non-empty for downstream SBI consumers (Nsmf_PDUSession CreateSMContext, UE context management, location reporting, MT notifications). Signed-off-by: Vinod Patmanathan <vinod.patmanathan@forsway.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
During a normal UE registration,
ue.RatTypeis never set. The only code path that assigns it isCreateUEContextProcedureinproducer/ue_context.go(inter-AMF relocation), and it does:go ue.RatType = ueContextCreateData.UeContext.RestrictedRatList[0] // minItem = -1That is wrong on two counts:
RestrictedRatListcontains RAT types the UE is not allowed to use — it's the opposite of whatRatTypemeans.[0]can panic.As a result, several SBI consumers (
Nsmf_PDUSessionCreateSMContext,Namf_CommunicationUE context management, location reporting, MT notifications) send an emptyratTypefield.Fix
ue.RatTypeinHandleRegistrationRequestbased on access type:NrLocation→NREutraLocation→EUTRAWLANRestrictedRatList[0]assignment inCreateUEContextProcedure.Test plan
go build ./...cleango vet ./...cleango test ./gmm/... ./producer/...passmake lint— 0 issues