From: Jeff Lucovsky Date: Fri, 17 Feb 2023 14:18:24 +0000 (-0500) Subject: pfring: Packet structure for ts fix X-Git-Tag: suricata-7.0.0-rc2~537 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d28c09ea1fe857cfada2c5a53e67af0380654f3;p=thirdparty%2Fsuricata.git pfring: Packet structure for ts fix 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. --- diff --git a/src/source-pfring.c b/src/source-pfring.c index 61423e2232..9911974911 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -231,7 +231,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 = SCTIME_FROM_TIMEVAL(&h->ts);