]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow-manager: only update FlowBucket::next_ts if it changed
authorVictor Julien <victor@inliniac.net>
Mon, 23 Dec 2019 19:22:37 +0000 (20:22 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Aug 2020 09:43:46 +0000 (11:43 +0200)
src/flow-manager.c

index 83672d48c75370e2e687697cd9f49414813ebc20..b8bb87acef7ee5e4c6d06dacf9b09e3f348dda05 100644 (file)
@@ -483,7 +483,9 @@ static uint32_t FlowTimeoutHash(struct timeval *ts, uint32_t try_cnt,
         /* we have a flow, or more than one */
         cnt += FlowManagerHashRowTimeout(fb->tail, ts, emergency, counters, &next_ts);
 
-        SC_ATOMIC_SET(fb->next_ts, next_ts);
+        if (SC_ATOMIC_GET(fb->next_ts) != next_ts) {
+            SC_ATOMIC_SET(fb->next_ts, next_ts);
+        }
 
 next:
         FBLOCK_UNLOCK(fb);