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 <hello@guidocasati.com>
This commit is contained in:
Robert Schmidt
2025-09-30 11:48:53 +02:00
committed by Guido Casati
co-authored by Guido Casati
parent a38aa1bab8
commit 12d92bc836
+2
View File
@@ -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);
}