Fixed CPHA missing protocol initialization

Improved IEC104 and IRC detection
This commit is contained in:
Luca Deri
2021-02-10 15:22:20 +01:00
parent 0de3d4c37a
commit e2f6569adb
7 changed files with 28 additions and 45 deletions
+11 -3
View File
@@ -34,7 +34,7 @@ void ndpi_search_iec60870_tcp(struct ndpi_detection_module_struct *ndpi_struct,
/* Check connection over TCP */
NDPI_LOG_DBG(ndpi_struct, "search IEC60870\n");
if(packet->tcp) {
u_int16_t offset = 0, found = 0;
@@ -45,8 +45,16 @@ void ndpi_search_iec60870_tcp(struct ndpi_detection_module_struct *ndpi_struct,
if(len == 0)
break;
else
offset += len + 2, found = 1;
else {
u_int8_t len = packet->payload[offset+1];
if((len + offset + 2) == packet->payload_packet_len) {
found = 1;
break;
}
offset += len + 2;
}
} else
break;
}