]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-ebpf: micro optimization
authorEric Leblond <eric@regit.org>
Mon, 4 Mar 2019 21:17:50 +0000 (22:17 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Jun 2019 05:07:02 +0000 (07:07 +0200)
src/util-ebpf.c

index 8bc5e8fa43aa6091ab1ad088b2db74c29ce0525b..431aceea51684e7310cb799226507e3624b18f1e 100644 (file)
@@ -493,13 +493,13 @@ static int EBPFUpdateFlowForKey(struct flows_stats *flowstats, FlowKey *flow_key
                 f->todstbytecnt = bytes_cnt;
                 /* interval based so no meaning to update the millisecond.
                  * Let's keep it fast and simple */
-                f->lastts.tv_sec = time(NULL);
+                f->lastts.tv_sec = ctime->tv_sec;
             }
         } else {
             if (pkts_cnt != f->tosrcpktcnt) {
                 f->tosrcpktcnt = pkts_cnt;
                 f->tosrcbytecnt = bytes_cnt;
-                f->lastts.tv_sec = time(NULL);
+                f->lastts.tv_sec = ctime->tv_sec;
             }
         }
         FLOWLOCK_UNLOCK(f);