From ec1991924679f4543df3a0a3ae5bfb9eda9a5729 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 22 Jun 2021 16:48:44 +0200 Subject: [PATCH] Fix NGAP valgrind test --- .../srsran/interfaces/gnb_ngap_interfaces.h | 20 +++++++++---------- srsenb/hdr/stack/ngap/ngap.h | 2 +- srsenb/test/ngap/ngap_test.cc | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/include/srsran/interfaces/gnb_ngap_interfaces.h b/lib/include/srsran/interfaces/gnb_ngap_interfaces.h index eed86ca4d..5d3fd92a8 100644 --- a/lib/include/srsran/interfaces/gnb_ngap_interfaces.h +++ b/lib/include/srsran/interfaces/gnb_ngap_interfaces.h @@ -18,16 +18,16 @@ namespace srsenb { struct ngap_args_t { - uint32_t gnb_id; // 20-bit id (lsb bits) - uint8_t cell_id; // 8-bit cell id - uint16_t tac; // 16-bit tac - uint16_t mcc; // BCD-coded with 0xF filler - uint16_t mnc; // BCD-coded with 0xF filler - std::string amf_addr; - std::string gtp_bind_addr; - std::string gtp_advertise_addr; - std::string ngc_bind_addr; - std::string gnb_name; + uint32_t gnb_id = 0; // 20-bit id (lsb bits) + uint8_t cell_id = 0; // 8-bit cell id + uint16_t tac = 0; // 16-bit tac + uint16_t mcc = 0; // BCD-coded with 0xF filler + uint16_t mnc = 0; // BCD-coded with 0xF filler + std::string amf_addr = ""; + std::string gtp_bind_addr = ""; + std::string gtp_advertise_addr = ""; + std::string ngc_bind_addr = ""; + std::string gnb_name = ""; }; // NGAP interface for RRC diff --git a/srsenb/hdr/stack/ngap/ngap.h b/srsenb/hdr/stack/ngap/ngap.h index 737d6022d..9ee160629 100644 --- a/srsenb/hdr/stack/ngap/ngap.h +++ b/srsenb/hdr/stack/ngap/ngap.h @@ -77,7 +77,7 @@ private: // args rrc_interface_ngap_nr* rrc = nullptr; - ngap_args_t args; + ngap_args_t args = {}; srslog::basic_logger& logger; srsran::task_sched_handle task_sched; srsran::task_queue_handle amf_task_queue; diff --git a/srsenb/test/ngap/ngap_test.cc b/srsenb/test/ngap/ngap_test.cc index d21bf7223..24a556b31 100644 --- a/srsenb/test/ngap/ngap_test.cc +++ b/srsenb/test/ngap/ngap_test.cc @@ -86,7 +86,7 @@ struct dummy_socket_manager : public srsran::socket_manager_itf { return true; } - int s1u_fd; + int s1u_fd = 0; recv_callback_t callback; }; @@ -141,7 +141,7 @@ int main(int argc, char** argv) args.ngc_bind_addr = "127.0.0.100"; args.tac = 7; args.gtp_bind_addr = "127.0.0.100"; - args.amf_addr = amf_addr_str; + args.amf_addr = "127.0.0.1"; args.gnb_name = "srsgnb01"; rrc_interface_ngap_nr rrc; ngap_obj.init(args, &rrc);