diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2021-10-03 21:38:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-03 21:38:49 +0200 |
commit | bc5be1e76cd8b3d6733f66bffe346486de89b8a0 (patch) | |
tree | 385115ff1b786fddb0e0ed3afe6805b0ddb6f51c /src/lib/protocols/sip.c | |
parent | e84da386c791caf79bbcf9b46357703c946473d9 (diff) |
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.
Diffstat (limited to 'src/lib/protocols/sip.c')
-rw-r--r-- | src/lib/protocols/sip.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/protocols/sip.c b/src/lib/protocols/sip.c index 35fcab656..2a0357789 100644 --- a/src/lib/protocols/sip.c +++ b/src/lib/protocols/sip.c @@ -178,8 +178,6 @@ void ndpi_search_sip_handshake(struct ndpi_detection_module_struct void ndpi_search_sip(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 sip\n"); if(flow->packet_counter > 5) @@ -187,9 +185,7 @@ void ndpi_search_sip(struct ndpi_detection_module_struct *ndpi_struct, struct nd else { /* skip marked packets */ if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_SIP) { - if(packet->tcp_retransmission == 0) { - ndpi_search_sip_handshake(ndpi_struct, flow); - } + ndpi_search_sip_handshake(ndpi_struct, flow); } } } @@ -199,7 +195,7 @@ void init_sip_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3 ndpi_set_bitmask_protocol_detection("SIP", ndpi_struct, detection_bitmask, *id, NDPI_PROTOCOL_SIP, ndpi_search_sip, - NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD,/* Fix courtesy of Miguel Quesada <mquesadab@gmail.com> */ + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,/* Fix courtesy of Miguel Quesada <mquesadab@gmail.com> */ SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); |