Enhanced fragments support in ndpiReader

Improved RX protocol dissection and removed port guess as it caused false positives.
This commit is contained in:
Luca Deri
2016-05-31 12:20:25 +02:00
parent a79b338208
commit 72efa329db
4 changed files with 11 additions and 7 deletions
+5 -2
View File
@@ -1532,8 +1532,11 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
ndpi_build_default_ports(ports_a, 1883, 8883, 0, 0, 0), /* TCP */
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0)); /* UDP */
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0);
ports_b[0].port_low = 7000;
ports_b[0].port_high = 7032; /* See https://www-01.ibm.com/support/docview.wss?uid=swg21044407 */
/* Port guess is disabled as this is UDP and we can figure our immediately looking
at the RX header, is this is RX or not
See https://www-01.ibm.com/support/docview.wss?uid=swg21044407
*/
ndpi_set_proto_defaults(ndpi_mod,NDPI_PROTOCOL_ACCEPTABLE,NDPI_PROTOCOL_RX,
no_master,
no_master, "RX",
+2 -3
View File
@@ -109,7 +109,7 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct,
**/
/* TYPE field */
if((header->type < DATA) && (header->type > VERSION)) {
if((header->type < DATA) || (header->type > VERSION)) {
NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX);
return;
@@ -171,8 +171,7 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct,
security:
/* SECURITY field */
if(header->security != 0 && header->security != 1 &&
header->security != 2 && header->security != 3)
if(header->security > 3)
{
NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX);