]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: Packet structure for ts fix 8810/head
authorJeff Lucovsky <jlucovsky@oisf.net>
Fri, 17 Feb 2023 14:18:24 +0000 (09:18 -0500)
committerVictor Julien <vjulien@oisf.net>
Thu, 4 May 2023 13:47:54 +0000 (15:47 +0200)
Issue: 5818

This commit addresses the issue with using the address of a packed
member of a structure. The pfring timeval is within a packed structure.

(cherry picked from commit 2d28c09ea1fe857cfada2c5a53e67af0380654f3)

src/source-pfring.c

index ece550bd857aa5dfb9f20feb75be710cd97e03eb..630872062ac79aea9150e71dcfbdbf106acb0a75 100644 (file)
@@ -229,7 +229,9 @@ static inline void PfringProcessPacket(void *user, struct pfring_pkthdr *h, Pack
 
     /* PF_RING may fail to set timestamp */
     if (h->ts.tv_sec == 0) {
-        gettimeofday((struct timeval *)&h->ts, NULL);
+        struct timeval tmp_ts;
+        gettimeofday(&tmp_ts, NULL);
+        h->ts = tmp_ts;
     }
 
     p->ts.tv_sec = h->ts.tv_sec;