Protobuf: fix false positives (#2428)
This commit is contained in:
@@ -201,7 +201,7 @@ static void ndpi_search_protobuf(struct ndpi_detection_module_struct *ndpi_struc
|
||||
if (packet->payload_packet_len < offset + sizeof(uint32_t))
|
||||
{
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG_PROTOBUF
|
||||
union {
|
||||
@@ -226,7 +226,9 @@ static void ndpi_search_protobuf(struct ndpi_detection_module_struct *ndpi_struc
|
||||
(unsigned long long int)protobuf_elements,
|
||||
(unsigned long long int)protobuf_len_elements);
|
||||
#endif
|
||||
if ((protobuf_elements >= PROTOBUF_REQUIRED_ELEMENTS && protobuf_len_elements > 0)
|
||||
if ((protobuf_elements >= PROTOBUF_REQUIRED_ELEMENTS && protobuf_len_elements > 0 &&
|
||||
/* (On UDP) this packet might be also a RTP/RTCP one. Wait for the next one */
|
||||
(flow->packet_counter > 1 || flow->l4_proto == IPPROTO_TCP || flow->l4.udp.rtp_stage == 0))
|
||||
|| (flow->packet_counter >= PROTOBUF_MIN_PACKETS && protobuf_elements >= PROTOBUF_MIN_ELEMENTS))
|
||||
{
|
||||
#ifdef DEBUG_PROTOBUF
|
||||
|
||||
Reference in New Issue
Block a user