From: Jeff Lucovsky Date: Tue, 7 Mar 2023 13:59:12 +0000 (-0500) Subject: nflog/time: Fixup timestamp handling X-Git-Tag: suricata-7.0.0-rc2~529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dbcbb2a2a384d2f3c595eff8f4945cde7dc481e;p=thirdparty%2Fsuricata.git nflog/time: Fixup timestamp handling Issue: 5818 This commit corrects the timestamp handling for the packet to work with the SCTime_t struct. --- diff --git a/src/source-nflog.c b/src/source-nflog.c index b2129b54f5..622e3df300 100644 --- a/src/source-nflog.c +++ b/src/source-nflog.c @@ -178,13 +178,13 @@ static int NFLOGCallback(struct nflog_g_handle *gh, struct nfgenmsg *msg, } else if (ret == -1) SET_PKT_LEN(p, 0); - ret = nflog_get_timestamp(nfa, &p->ts); + struct timeval tv; + ret = nflog_get_timestamp(nfa, &tv); if (ret != 0) { - struct timeval tv; - memset(&tv, 0, sizeof(struct timeval)); + memset(&tv, 0, sizeof(tv)); gettimeofday(&tv, NULL); - p->ts = SCTIME_FROM_TIMEVAL(&tv); } + p->ts = SCTIME_FROM_TIMEVAL(&tv); p->datalink = DLT_RAW;