Skip to content

Commit

Permalink
ndpiReader: fix flow stats (#1943)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi authored Apr 14, 2023
1 parent 032e778 commit ba99330
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/ndpiReader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 : "");
Expand Down
2 changes: 1 addition & 1 deletion example/reader_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ba99330

Please sign in to comment.