From: Jeff Lucovsky Date: Sun, 29 Jan 2023 14:28:38 +0000 (-0500) Subject: pfring/time: Track stat output with SCTime_t X-Git-Tag: suricata-7.0.0-rc2~538 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=056c13c417461a3b9eaf0cc7f60d7b442912c25a;p=thirdparty%2Fsuricata.git pfring/time: Track stat output with SCTime_t Issue: 5818 This commit changes the datatype of the tracking value for the last time stats were dumped. Changing the type also eliminates a comparison between values with different signs. --- diff --git a/src/source-pfring.c b/src/source-pfring.c index 36b1c26ac9..61423e2232 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -347,7 +347,7 @@ TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot) Packet *p = NULL; struct pfring_pkthdr hdr; TmSlot *s = (TmSlot *)slot; - time_t last_dump = 0; + SCTime_t last_dump = SCTIME_INITIALIZER; u_int buffer_size; u_char *pkt_buffer; @@ -422,9 +422,9 @@ TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot) } /* Trigger one dump of stats every second */ - if (SCTIME_SECS(p->ts) != last_dump) { + if (SCTIME_CMP_NEQ(p->ts, last_dump)) { PfringDumpCounters(ptv); - last_dump = SCTIME_SECS(p->ts); + last_dump = p->ts; } } else if (unlikely(r == 0)) { if (suricata_ctl_flags & SURICATA_STOP) {