Fixed eDonkey false positives

This commit is contained in:
Luca Deri
2018-12-12 08:58:34 +01:00
parent 181ec4992b
commit c1d31bb409
+2 -1
View File
@@ -35,7 +35,6 @@ static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct
} }
static int ndpi_edonkey_payload_check(const u_int8_t *data, u_int32_t len) { static int ndpi_edonkey_payload_check(const u_int8_t *data, u_int32_t len) {
if((len >= 4) && (data[0] == 0xe3) && (data[2] == 0x00) && (data[3] == 0x00)) if((len >= 4) && (data[0] == 0xe3) && (data[2] == 0x00) && (data[3] == 0x00))
return 1; return 1;
@@ -166,6 +165,8 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
return; return;
} }
if(payload_len == 0) return;
/* Check if we so far detected the protocol in the request or not. */ /* Check if we so far detected the protocol in the request or not. */
if(flow->edonkey_stage == 0) { if(flow->edonkey_stage == 0) {
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage 0: \n"); NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage 0: \n");