STUN: fix flow risks when DTLS packets are found (#2266)

When switching to (D)TLS dissector from the STUN one, we need to clear
any flow risks set from the latter (because we don't have anymore
`NDPI_PROTOCOL_STUN` in the classification results)
This commit is contained in:
Ivan Nardi
2024-01-19 08:57:39 +01:00
committed by GitHub
parent 6ac2ce84f8
commit c83698c957
6 changed files with 7 additions and 5 deletions
+2
View File
@@ -440,6 +440,8 @@ static int stun_search_again(struct ndpi_detection_module_struct *ndpi_struct,
/* TODO: right way? It is a bit scary... do we need to reset something else too? */
reset_detected_protocol(ndpi_struct, flow);
change_category(ndpi_struct, flow, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED);
/* STUN often triggers this risk; clear it. TODO: clear other risks? */
ndpi_unset_risk(ndpi_struct, flow, NDPI_KNOWN_PROTOCOL_ON_NON_STANDARD_PORT);
/* Give room for DTLS handshake, where we might have
retransmissions and fragments */