From b3bfe336a9d0b1e3cf0714f8ae3e583e11405337 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 28 Sep 2020 12:48:31 +0000 Subject: [PATCH] Make sure that remote address test has a ip mask --- srsue/hdr/stack/upper/tft_packet_filter.h | 48 +++++++++++------------ srsue/test/upper/tft_test.cc | 5 ++- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/srsue/hdr/stack/upper/tft_packet_filter.h b/srsue/hdr/stack/upper/tft_packet_filter.h index 99cbf1ee5..c97c3e76d 100644 --- a/srsue/hdr/stack/upper/tft_packet_filter.h +++ b/srsue/hdr/stack/upper/tft_packet_filter.h @@ -75,30 +75,30 @@ public: bool match(const srslte::unique_byte_buffer_t& pdu); bool filter_contains(uint16_t filtertype); - uint8_t eps_bearer_id; - uint8_t lcid; - uint8_t id; - uint8_t eval_precedence; - uint32_t active_filters; - uint32_t ipv4_remote_addr; - uint32_t ipv4_remote_addr_mask; - uint32_t ipv4_local_addr; - uint32_t ipv4_local_addr_mask; - uint8_t ipv6_remote_addr[16]; - uint8_t ipv6_remote_addr_mask[16]; - uint8_t ipv6_remote_addr_length; - uint8_t ipv6_local_addr[16]; - uint8_t ipv6_local_addr_mask[16]; - uint8_t ipv6_local_addr_length; - uint8_t protocol_id; - uint16_t single_local_port; - uint16_t local_port_range[2]; - uint16_t single_remote_port; - uint16_t remote_port_range[2]; - uint32_t security_parameter_index; - uint8_t type_of_service; - uint8_t type_of_service_mask; - uint8_t flow_label[3]; + uint8_t eps_bearer_id {}; + uint8_t lcid = {}; + uint8_t id = {}; + uint8_t eval_precedence = {}; + uint32_t active_filters = {}; + uint32_t ipv4_remote_addr = {}; + uint32_t ipv4_remote_addr_mask = {}; + uint32_t ipv4_local_addr = {}; + uint32_t ipv4_local_addr_mask = {}; + uint8_t ipv6_remote_addr[16] = {}; + uint8_t ipv6_remote_addr_mask[16] = {}; + uint8_t ipv6_remote_addr_length = {}; + uint8_t ipv6_local_addr[16] = {}; + uint8_t ipv6_local_addr_mask[16] = {}; + uint8_t ipv6_local_addr_length = {}; + uint8_t protocol_id = {}; + uint16_t single_local_port = {}; + uint16_t local_port_range[2] = {}; + uint16_t single_remote_port = {}; + uint16_t remote_port_range[2] = {}; + uint32_t security_parameter_index = {}; + uint8_t type_of_service = {}; + uint8_t type_of_service_mask = {}; + uint8_t flow_label[3] = {}; srslte::log* log; diff --git a/srsue/test/upper/tft_test.cc b/srsue/test/upper/tft_test.cc index 765bfbffd..17b229a7c 100644 --- a/srsue/test/upper/tft_test.cc +++ b/srsue/test/upper/tft_test.cc @@ -330,10 +330,11 @@ int tft_filter_test_ipv4_remote_addr() // Filter length: 5 bytes // Filter type: IPv4 local address // Remote address: 127.0.0.2 - uint8_t filter_message[5]; - uint8_t filter_size = 5; + uint8_t filter_message[9]; + uint8_t filter_size = 9; filter_message[0] = IPV4_REMOTE_ADDR_TYPE; inet_pton(AF_INET, "127.0.0.2", &filter_message[1]); + inet_pton(AF_INET, "255.0.0.0", &filter_message[5]); // Set IP test message ip_msg1->N_bytes = ip_message_len1;