Merge remote-tracking branch 'origin/fix-bug-release-no-amf' into integration_2026_w03 (!3857)
Fix bug "no AMF for UE" It might happen that the RRC does not know the AMF UE NGAP ID, yet. Even in that case, we should forward the release request to the NGAP module, which can either forward a message to the AMF, or reply back to release the UE. This avoids an error where the CU claims there was no AMF, when there actually is. One possible problematic behavior is if a UE disconnects before the gNB receives an NGAP Initial Context Setup. In this case, the AMF UE NGAP ID was not forwarded to the RRC (although it was known at NGAP), thus blocking the release of the UE. This is the main fix, the rest are minor fixes: - store AMF UE NGAP ID as early as possible - warn in MAC if UE unknown for UE context release command - show TEIDs with correct endianness in GTP - avoid NG Setup Failure+Setup log.
This commit is contained in:
@@ -737,6 +737,8 @@ typedef struct ngap_ue_ctxt_modification_resp_s {
|
||||
typedef struct ngap_downlink_nas_s {
|
||||
/* UE id for initial connection to NGAP */
|
||||
uint32_t gNB_ue_ngap_id;
|
||||
/* UE id at AMF */
|
||||
uint64_t amf_ue_ngap_id;
|
||||
/* NAS pdu */
|
||||
byte_array_t nas_pdu;
|
||||
} ngap_downlink_nas_t;
|
||||
|
||||
@@ -888,6 +888,7 @@ void ue_context_release_command(const f1ap_ue_context_rel_cmd_t *cmd)
|
||||
UE = UE ? UE : find_ra_UE(&mac->UE_info, cmd->gNB_DU_ue_id);
|
||||
if (UE == NULL) {
|
||||
NR_SCHED_UNLOCK(&mac->sched_lock);
|
||||
LOG_W(NR_MAC, "UE Context Release Command for unknown RNTI %04x/CU UE ID %d\n", cmd->gNB_DU_ue_id, cmd->gNB_CU_ue_id);
|
||||
f1ap_ue_context_rel_cplt_t complete = {
|
||||
.gNB_CU_ue_id = cmd->gNB_CU_ue_id,
|
||||
.gNB_DU_ue_id = cmd->gNB_DU_ue_id,
|
||||
|
||||
@@ -2440,10 +2440,8 @@ static void rrc_CU_process_ue_context_release_request(MessageDef *msg_p, sctp_as
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[instance];
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, req->gNB_CU_ue_id);
|
||||
int srbid = 1;
|
||||
// valid AMF UE NGAP ID range is 0..2^40-1
|
||||
if (!ue_context_p || ue_context_p->ue_context.amf_ue_ngap_id >= (1LL << 40)) {
|
||||
const char *reason = !ue_context_p ? "could not find UE context" : "no AMF";
|
||||
LOG_W(RRC, "%s for CU UE ID %u: auto-generate release command\n", reason, req->gNB_CU_ue_id);
|
||||
if (!ue_context_p) {
|
||||
LOG_W(RRC, "could not find UE context for CU UE ID %u: auto-generate release command\n", req->gNB_CU_ue_id);
|
||||
uint8_t buffer[NR_RRC_BUF_SIZE] = {0};
|
||||
int size = do_NR_RRCRelease(buffer, NR_RRC_BUF_SIZE, rrc_gNB_get_next_transaction_identifier(0));
|
||||
RETURN_IF_INVALID_ASSOC_ID(assoc_id);
|
||||
|
||||
@@ -717,6 +717,7 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu
|
||||
}
|
||||
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
UE->amf_ue_ngap_id = req->amf_ue_ngap_id;
|
||||
UE->nas_pdu = req->nas_pdu;
|
||||
rrc_forward_ue_nas_message(rrc, UE);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user