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.

(cherry picked from commit 2d28c09ea1)
pull/8810/head
Jeff Lucovsky 4 years ago committed by Victor Julien
parent 0730fdcd6b
commit cb71800f7b

@ -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;

Loading…
Cancel
Save