From 12d92bc836a65b2f09f50d591564845a385b67e7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 19 Sep 2025 10:33:25 +0200 Subject: [PATCH] Fix crash in get_du_for_ue when F1 UE data does not exist Add check for cu_exists_f1_ue_data() before calling cu_get_f1_ue_data() to prevent assertion failure when telnet command 'ci fetch_du_by_ue_id' is used for UEs that have been handed over via N2 (and no longer have F1 UE data). This fixes the crash: Assertion (ret == HASH_TABLE_OK && data != ((void *)0)) failed! In get_hashtable_data() /oai-ran/openair2/F1AP/f1ap_ids.c:36 element for ue_id 1 not found The function now returns NULL gracefully when F1 UE data is not available. Co-authored-by: Guido Casati --- openair2/RRC/NR/rrc_gNB_du.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_du.c b/openair2/RRC/NR/rrc_gNB_du.c index db1a9cd459..e104641edc 100644 --- a/openair2/RRC/NR/rrc_gNB_du.c +++ b/openair2/RRC/NR/rrc_gNB_du.c @@ -619,6 +619,8 @@ void rrc_CU_process_f1_lost_connection(gNB_RRC_INST *rrc, f1ap_lost_connection_t nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id) { + if (!cu_exists_f1_ue_data(ue_id)) + return NULL; f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_id); return get_du_by_assoc_id(rrc, ue_data.du_assoc_id); }