From 706ee91305516a7e035fa48a5467171f81b23815 Mon Sep 17 00:00:00 2001 From: Nardi Ivan Date: Thu, 13 Apr 2023 10:05:36 +0200 Subject: [PATCH] ndpiReader: fix flow stats --- example/ndpiReader.c | 2 +- example/reader_util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 38da4e842e5..05f362ce909 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -818,7 +818,7 @@ static void parseOptions(int argc, char **argv) { for(i = 0; i < NDPI_MAX_SUPPORTED_PROTOCOLS; i++) aggressiveness[i] = -1; /* Use the default value */ - while((opt = getopt_long(argc, argv, "a:Ab:B:e:Ec:C:dDf:g:i:Ij:k:K:S:hHp:pP:l:r:s:tu:v:V:n:rp:x:w:zZ:q0123:456:7:89:m:MT:U:", + while((opt = getopt_long(argc, argv, "a:Ab:B:e:Ec:C:dDFf:g:i:Ij:k:K:S:hHp:pP:l:r:s:tu:v:V:n:rp:x:w:zZ:q0123:456:7:89:m:MT:U:", longopts, &option_idx)) != EOF) { #ifdef DEBUG_TRACE if(trace) fprintf(trace, " #### Handling option -%c [%s] #### \n", opt, optarg ? optarg : ""); diff --git a/example/reader_util.c b/example/reader_util.c index 3395153b024..18059f7942b 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -983,7 +983,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow *src_to_dst_direction = 1; } if(enable_flow_stats) { - if(src_to_dst_direction) { + if(*src_to_dst_direction) { if(rflow->entropy->src2dst_pkt_count < max_num_packets_per_flow) { rflow->entropy->src2dst_pkt_len[rflow->entropy->src2dst_pkt_count] = l4_data_len; rflow->entropy->src2dst_pkt_time[rflow->entropy->src2dst_pkt_count] = when;