]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
bypass: fix accounting
authorEric Leblond <eric@regit.org>
Wed, 5 Jun 2019 13:12:13 +0000 (15:12 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Jun 2019 05:07:02 +0000 (07:07 +0200)
The flow bypass stats is computed at every pass so the accounting
needs to be done at each pass. This patch fixes the accounting
in the flow_bypassed counters.

src/flow-bypass.c

index ae7b2f621f8a6e856840b986b1378263c2013da8..d15b44da402be0c09bff35f23a7dcde263fb7492 100644 (file)
@@ -85,9 +85,9 @@ static TmEcode BypassedFlowManager(ThreadVars *th_v, void *thread_data)
             tcount = bypassedfunclist[i].Func(th_v, &bypassstats, &curtime, bypassedfunclist[i].data);
             if (tcount) {
                 StatsAddUI64(th_v, ftd->flow_bypassed_cnt_clo, (uint64_t)bypassstats.count);
-                StatsAddUI64(th_v, ftd->flow_bypassed_pkts, (uint64_t)bypassstats.packets);
-                StatsAddUI64(th_v, ftd->flow_bypassed_bytes, (uint64_t)bypassstats.bytes);
             }
+            StatsAddUI64(th_v, ftd->flow_bypassed_pkts, (uint64_t)bypassstats.packets);
+            StatsAddUI64(th_v, ftd->flow_bypassed_bytes, (uint64_t)bypassstats.bytes);
         }
 
         if (TmThreadsCheckFlag(th_v, THV_KILL)) {