From 5bd5461f966c5270d8a23ad22f5aab6506c95866 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Sat, 12 Dec 2020 11:12:59 +0100 Subject: Fix minimum packet length condition (#1087) --- example/reader_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example/reader_util.c') diff --git a/example/reader_util.c b/example/reader_util.c index 8546c427e..c340884a3 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1616,7 +1616,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow, datalink_check: - if(header->caplen < eth_offset + 40) + // 20 for min iph and 8 for min UDP + if(header->caplen < eth_offset + 28) return(nproto); /* Too short */ switch(datalink_type) { -- cgit v1.2.3