From d60dfa552ac7e1a4f7e8872dc1dcb8a813a7c12f Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 3 Sep 2021 11:40:53 -0700 Subject: [PATCH] Properly initializing the PDCP layer Previously, the ue_id passed into the init_pdcp() in the proxy would be 41. This is outside of the bounds of the nas_sock_fd array and would cause a crash. This was occuring because the node_number in the NRUE starts at 2, not 1. --- executables/nr-uesoftmodem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index f73e866758..ee1f62bab9 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -403,10 +403,9 @@ void init_pdcp(int ue_id) { if (rlc_module_init(0) != 0) { LOG_I(RLC, "Problem at RLC initiation \n"); } - if(!IS_SOFTMODEM_NOS1) { - pdcp_layer_init(); - nr_pdcp_module_init(pdcp_initmask, ue_id); - } + pdcp_layer_init(); + nr_pdcp_module_init(pdcp_initmask, ue_id); + pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); @@ -473,7 +472,7 @@ int main( int argc, char **argv ) { } else { - init_pdcp(mode_offset + node_number - 1); + init_pdcp(mode_offset + ue_id_g); } NB_UE_INST=1;