From bc5be1e76cd8b3d6733f66bffe346486de89b8a0 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sun, 3 Oct 2021 21:38:49 +0200 Subject: Fix how some protocols handle tcp retransmissions (#1321) Most (all?) protocols don't care about (tcp) retransmissions. If a protocol registers itself with a NDPI_SELECTION_BITMASK_PROTOCOL_*_WITHOUT_RETRANSMISSION value, its callback is never triggered with a retransmitted packet. --- src/lib/protocols/spotify.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/lib/protocols/spotify.c') diff --git a/src/lib/protocols/spotify.c b/src/lib/protocols/spotify.c index 9150b40db..b0a077251 100644 --- a/src/lib/protocols/spotify.c +++ b/src/lib/protocols/spotify.c @@ -121,15 +121,11 @@ static void ndpi_check_spotify(struct ndpi_detection_module_struct *ndpi_struct, void ndpi_search_spotify(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - struct ndpi_packet_struct *packet = &flow->packet; - NDPI_LOG_DBG(ndpi_struct, "search spotify\n"); /* skip marked packets */ if (flow->detected_protocol_stack[0] != NDPI_PROTOCOL_SPOTIFY) { - if (packet->tcp_retransmission == 0) { - ndpi_check_spotify(ndpi_struct, flow); - } + ndpi_check_spotify(ndpi_struct, flow); } } @@ -139,7 +135,7 @@ void init_spotify_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_ ndpi_set_bitmask_protocol_detection("SPOTIFY", ndpi_struct, detection_bitmask, *id, NDPI_PROTOCOL_SPOTIFY, ndpi_search_spotify, - NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); -- cgit v1.2.3