Skip to content

fix: set RatType correctly during registration#685

Closed
donivtech wants to merge 1 commit into
omec-project:mainfrom
donivtech:fix/rat-type-from-access-type
Closed

fix: set RatType correctly during registration#685
donivtech wants to merge 1 commit into
omec-project:mainfrom
donivtech:fix/rat-type-from-access-type

Conversation

@donivtech
Copy link
Copy Markdown
Contributor

Problem

During a normal UE registration, ue.RatType is never set. The only code path that assigns it is CreateUEContextProcedure in producer/ue_context.go (inter-AMF relocation), and it does:

go ue.RatType = ueContextCreateData.UeContext.RestrictedRatList[0] // minItem = -1

That is wrong on two counts:

  • RestrictedRatList contains RAT types the UE is not allowed to use — it's the opposite of what RatType means.
  • The list's minimum item count is -1 (i.e. it can be empty or nil), so indexing [0] can panic.

As a result, several SBI consumers (Nsmf_PDUSession CreateSMContext, Namf_Communication UE context management, location reporting, MT notifications) send an empty ratType field.

Fix

  • Set ue.RatType in HandleRegistrationRequest based on access type:
    • 3GPP access + NrLocationNR
    • 3GPP access + EutraLocationEUTRA
    • Non-3GPP access → WLAN
  • Remove the buggy RestrictedRatList[0] assignment in CreateUEContextProcedure .

Test plan

  • go build ./... clean
  • go vet ./... clean
  • go test ./gmm/... ./producer/... pass
  • make lint — 0 issues

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>
@donivtech
Copy link
Copy Markdown
Contributor Author

Holding this until PR #684 (NR NTN access detection) gets maintainer feedback — naming/architecture decisions there can also apply here. Branch kept on the fork; will reopen when #684 lands.

@donivtech donivtech closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant