From 542ef1c1c6622aea7fec31e82aa3e9f959af2634 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Oct 2024 18:15:49 +0200 Subject: [PATCH] Handle fault rrcReestablishmentComplete gracefully A UE might send a rrcReestablishmentComplete without the actual IEs present (intentionally or not). Check this and handle appropriately to avoid assertion Assertion (reestablishment_complete->criticalExtensions.present == NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete) failed! In handle_rrcReestablishmentComplete() ../../../openair2/RRC/NR/rrc_gNB.c:1364 Closes: #854 --- openair2/RRC/NR/rrc_gNB.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index a4b4a427d7..3dd43b99ce 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1364,8 +1364,11 @@ static int handle_rrcReestablishmentComplete(const protocol_ctxt_t *const ctxt_p DevAssert(ue_context_p != NULL); gNB_RRC_UE_t *UE = &ue_context_p->ue_context; - DevAssert(reestablishment_complete->criticalExtensions.present - == NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete); + NR_RRCReestablishmentComplete__criticalExtensions_PR p = reestablishment_complete->criticalExtensions.present; + if (p != NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete) { + LOG_E(NR_RRC, "UE %d: expected presence of rrcReestablishmentComplete, but message has %d\n", UE->rrc_ue_id, p); + return -1; + } rrc_gNB_process_RRCReestablishmentComplete(ctxt_pP, ue_context_p, reestablishment_complete->rrc_TransactionIdentifier); UE->ue_reestablishment_counter++;