From 95e4270ea70ea743a15b984bd4d3110096db7c9e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 31 Mar 2026 22:26:30 +0200 Subject: [PATCH 1/3] bugfix: do not trigger e1 bearer setup when no PDU session It can happen that no PDU session can be setup (e.g., PDU session already setup). Check that there is at least one before triggering the message. Also initialize bearer_req.gNB_cu_cp_ue_id early to avoid uninitialized IDs (e.g., when no PDU session to be setup). --- openair2/RRC/NR/rrc_gNB_NGAP.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index f2971f199b..035447be55 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -354,7 +354,9 @@ bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession return false; } AssertFatal(UE->as_security_active, "logic bug: security should be active when activating DRBs\n"); - e1ap_bearer_setup_req_t bearer_req = {0}; + e1ap_bearer_setup_req_t bearer_req = { + .gNB_cu_cp_ue_id = UE->rrc_ue_id, + }; // Reject bearers setup if there's no CU-UP associated if (!is_cuup_associated(rrc)) { @@ -412,6 +414,10 @@ bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession pdu->DRBnGRanList[0] = fill_e1_drb_to_setup(rrc_drb, session, rrc->configuration.um_on_default_drb, UE->redcap_cap); } } + if (bearer_req.numPDUSessions == 0) { + LOG_W(NR_RRC, "UE %d: No PDU sessions to setup, skipping bearer context setup\n", UE->rrc_ue_id); + return false; + } /* Limitation: we assume one fixed CU-UP per UE. We base the selection on * NSSAI, but the UE might have multiple PDU sessions with differing slices, * in which we might need to select different CU-UPs. In this case, we would From 1e9476a6de673d8f3d70ea9182a3c5def3628919 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 31 Mar 2026 22:31:07 +0200 Subject: [PATCH 2/3] E1 message: handle if no UE found Abort message processing if no UE can be found, which is what is done in most other messages. --- openair2/RRC/NR/rrc_gNB.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2d876cce25..260193bb4e 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3041,7 +3041,10 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp { gNB_RRC_INST *rrc = RC.nrrrc[0]; rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, resp->gNB_cu_cp_ue_id); - AssertFatal(ue_context_p != NULL, "did not find UE with CU UE ID %d\n", resp->gNB_cu_cp_ue_id); + if (ue_context_p == NULL) { + LOG_E(NR_RRC, "no UE with CU-CP UE ID %d found\n", resp->gNB_cu_cp_ue_id); + return; + } gNB_RRC_UE_t *UE = &ue_context_p->ue_context; // currently: we don't have "infrastructure" to save the CU-UP UE ID, so we From 1a3bf557cf0491d07d65e3a3f92fa3cfdd508d99 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 31 Mar 2026 22:34:33 +0200 Subject: [PATCH 3/3] delay transaction: handle if no UE found It can happen that a message is delayed, but then no UE is found for such message, e.g., something is delayed but the UE context is deleted in the meantime: [02:23:16.320730] [NR_RRC] I [--] (UE ID 3 RNTI d2b1) Remove UE context Assertion (ue_context_p) failed! In rrc_delay_transaction() /oai-ran/openair2/RRC/NR/rrc_gNB.c:191 In that case, don't delay the message further -- all handlers gated by this function will check for the UE context and abort the transaction if not present. --- openair2/RRC/NR/rrc_gNB.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 260193bb4e..8cf5fb1378 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -166,7 +166,8 @@ static bool rrc_delay_transaction(instance_t instance, MessageDef *msg_p) AssertFatal(cu_ue_id > 0, "cu_ue_id not found in message %s\n", ITTI_MSG_NAME(msg_p)); rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[instance], cu_ue_id); - DevAssert(ue_context_p); + if (!ue_context_p) + return false; // nothing to delay gNB_RRC_UE_t *UE = &ue_context_p->ue_context; bool delay = UE->delayed_action.ongoing_transaction && UE->delayed_action.max_delays > 0;