]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3447: perf_monitor: fix timestamp for idle processing
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 31 May 2022 14:41:24 +0000 (14:41 +0000)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 31 May 2022 14:41:24 +0000 (14:41 +0000)
Merge in SNORT/snort3 from ~OSERHIIE/snort3:bug_CSCvx76013 to master

Squashed commit of the following:

commit 48030fe21edd2181ff9c642b9f43f75ce965ef28
Author: Oleksandr Serhiienko <oserhiie@cisco.com>
Date:   Fri May 27 10:12:26 2022 +0300

    perf_monitor: fix timestamp for idle processing

        This change provides a fix for the case when traffic has been stopped
        somewhere in the middle of reporting interval.

        If it happens, reporting falls into idle processing and still makes
        records in time but logged timestamp value is wrong since it was not
        updated for trackers since the last packet gone.

        Subsequent time intervals are fine.

src/network_inspectors/perf_monitor/perf_monitor.cc

index 7c9b7bd817b42b51f282a9f610f41118c0cba5e0..ff2881f5167be4f7d26781b17e3eec382183544b 100644 (file)
@@ -387,7 +387,7 @@ bool PerfMonitor::ready_to_process(Packet* p)
     {
         if ((cur_time - sample_time) >= t_constraints->sample_interval)
         {
-            if (cnt == 0)
+            if (!p)
                 for (auto& tracker : *trackers)
                     tracker->update_time(cur_time);