aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/stun.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-07-03 17:21:32 +0200
committerGitHub <noreply@github.com>2023-07-03 17:21:32 +0200
commitdff1f251939935b43943dea00ef24ef85261b94a (patch)
treec3aa083972d1c9182eb6d2e0b083e5325e3fa9a4 /src/lib/protocols/stun.c
parent86e89b4e230371b2de92e3a3cda6fdea42fff614 (diff)
STUN: fix Skype/MsTeams detection and monitoring logic (#2028)
Diffstat (limited to 'src/lib/protocols/stun.c')
-rw-r--r--src/lib/protocols/stun.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 3dab65770..81e90e94f 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -51,7 +51,8 @@ static int stun_monitoring(struct ndpi_detection_module_struct *ndpi_struct,
u_int8_t first_byte;
#ifdef DEBUG_MONITORING
- printf("[STUN-MON] Packet counter %d\n", flow->packet_counter);
+ printf("[STUN-MON] Packet counter %d protos %d/%d\n", flow->packet_counter,
+ flow->detected_protocol_stack[0], flow->detected_protocol_stack[1]);
#endif
if(packet->payload_packet_len == 0)
@@ -261,6 +262,10 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
0 /* dummy */, ndpi_get_current_time(flow));
}
+
+#ifdef DEBUG_STUN
+ printf("[STUN] Setting %d\n", app_proto);
+#endif
ndpi_set_detected_protocol(ndpi_struct, flow, app_proto, NDPI_PROTOCOL_STUN, confidence);
if(ndpi_struct->monitoring_stun_pkts_to_process > 0 &&
@@ -268,7 +273,7 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
* multiple msg in the same TCP segment
* same msg split across multiple segments */) {
if((ndpi_struct->monitoring_stun_flags & NDPI_MONITORING_STUN_SUBCLASSIFIED) ||
- app_proto == NDPI_PROTOCOL_UNKNOWN /* No-subclassification */) {
+ flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN /* No-subclassification */) {
flow->max_extra_packets_to_check = ndpi_struct->monitoring_stun_pkts_to_process;
flow->extra_packets_func = stun_monitoring;
}