aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorIvan Nardi <nardi.ivan@gmail.com>2025-06-23 17:27:39 +0200
committerIvan Nardi <nardi.ivan@gmail.com>2025-06-23 17:27:39 +0200
commit06a49b4086257f46fd44a1f9f176a539fb49bcdc (patch)
tree4a17926bf95d1a4898cd15da93340de9d25f1f3f /example/reader_util.c
parent64ea82ce2808e6647d1496872ed011f4b2efb628 (diff)
ndpiReader: fix check on max number of packets per flow
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 8233f3fe7..1ea42daaa 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -1907,8 +1907,8 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
struct ndpi_flow_input_info input_info;
u_int enough_packets =
- ((proto == IPPROTO_UDP && (max_num_udp_dissected_pkts > 0 && flow->src2dst_packets + flow->dst2src_packets > max_num_udp_dissected_pkts)) ||
- (proto == IPPROTO_TCP && (max_num_tcp_dissected_pkts > 0 && flow->src2dst_packets + flow->dst2src_packets > max_num_tcp_dissected_pkts))) ? 1 : 0;
+ ((proto == IPPROTO_UDP && (max_num_udp_dissected_pkts > 0 && flow->src2dst_packets + flow->dst2src_packets >= max_num_udp_dissected_pkts)) ||
+ (proto == IPPROTO_TCP && (max_num_tcp_dissected_pkts > 0 && flow->src2dst_packets + flow->dst2src_packets >= max_num_tcp_dissected_pkts))) ? 1 : 0;
#if 0
printf("%s()\n", __FUNCTION__);