From: Mike Stepanek (mstepane) Date: Tue, 31 May 2022 14:41:24 +0000 (+0000) Subject: Pull request #3447: perf_monitor: fix timestamp for idle processing X-Git-Tag: 3.1.31.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bde101423d94a979a92c8f6fe1d75f99e6e8840;p=thirdparty%2Fsnort3.git Pull request #3447: perf_monitor: fix timestamp for idle processing Merge in SNORT/snort3 from ~OSERHIIE/snort3:bug_CSCvx76013 to master Squashed commit of the following: commit 48030fe21edd2181ff9c642b9f43f75ce965ef28 Author: Oleksandr Serhiienko 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. --- diff --git a/src/network_inspectors/perf_monitor/perf_monitor.cc b/src/network_inspectors/perf_monitor/perf_monitor.cc index 7c9b7bd81..ff2881f51 100644 --- a/src/network_inspectors/perf_monitor/perf_monitor.cc +++ b/src/network_inspectors/perf_monitor/perf_monitor.cc @@ -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);