From 48a7f6d487862a392bad65e9e2797e6c4874f8cb Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:49:11 +0100 Subject: fuzz: some enhancements (#1827) Load some custom configuration (like in the unit tests) and factorize some (fuzzing) common code. There is no way to pass file paths to the fuzzers as parameters. The safe solution seems to be to load them from the process working dir. Anyway, missing file is not a blocking error. Remove some dead code (found looking at the coverage report) --- src/lib/protocols/sip.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/lib/protocols/sip.c') diff --git a/src/lib/protocols/sip.c b/src/lib/protocols/sip.c index 9862c5c1e..6352b27d7 100644 --- a/src/lib/protocols/sip.c +++ b/src/lib/protocols/sip.c @@ -185,12 +185,6 @@ void ndpi_search_sip_handshake(struct ndpi_detection_module_struct return; } - /* for STUN flows we need some more packets */ - if(packet->udp != NULL && flow->detected_protocol_stack[0] == NDPI_PROTOCOL_STUN && flow->packet_counter < 40) { - NDPI_LOG_DBG2(ndpi_struct, "need next STUN packet\n"); - return; - } - if(payload_len == 4 && get_u_int32_t(packet_payload, 0) == 0) { NDPI_LOG_DBG2(ndpi_struct, "maybe sip. need next packet\n"); return; @@ -203,10 +197,7 @@ void ndpi_search_sip(struct ndpi_detection_module_struct *ndpi_struct, struct nd { NDPI_LOG_DBG(ndpi_struct, "search sip\n"); - /* skip marked packets */ - if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_SIP) { - ndpi_search_sip_handshake(ndpi_struct, flow); - } + ndpi_search_sip_handshake(ndpi_struct, flow); } void init_sip_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) -- cgit v1.2.3