From 2c2b7416c1fc63711d1d0c54aef5035080f4b7b1 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 18 Apr 2024 14:52:09 +0200 Subject: [PATCH] Check numDlUpParam size when processing DlUpParamList --- openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c index e18c8eddfb..a34d8649d7 100644 --- a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c +++ b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c @@ -261,10 +261,12 @@ void e1_bearer_context_modif(const e1ap_bearer_mod_req_t *req) if (f1inst < 0) // no F1-U? continue; // nothing to do - in_addr_t addr = {0}; - memcpy(&addr, &to_modif->DlUpParamList[0].tlAddress, sizeof(in_addr_t)); - - GtpuUpdateTunnelOutgoingAddressAndTeid(f1inst, req->gNB_cu_cp_ue_id, to_modif->id, addr, to_modif->DlUpParamList[0].teId); + /* Loop through DL UP Transport Layer params list + * and update GTP tunnel outgoing addr and TEID */ + for (int k = 0; k < to_modif->numDlUpParam; k++) { + in_addr_t addr = to_modif->DlUpParamList[k].tlAddress; + GtpuUpdateTunnelOutgoingAddressAndTeid(f1inst, req->gNB_cu_cp_ue_id, to_modif->id, addr, to_modif->DlUpParamList[k].teId); + } } }