time: fix various time issues

Found by Coverity Scan.
pull/8435/head
Victor Julien 3 years ago
parent 06caef988c
commit 420351eda2

@ -247,7 +247,6 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p,
(uint16_t *)p->tcph, 20, 0);
}
memset(&p->ts, 0, sizeof(struct timeval));
p->ts = TimeGet();
if (direction == 0) {

@ -180,8 +180,10 @@ static int NFLOGCallback(struct nflog_g_handle *gh, struct nfgenmsg *msg,
ret = nflog_get_timestamp(nfa, &p->ts);
if (ret != 0) {
memset(&p->ts, 0, sizeof(struct timeval));
gettimeofday(&p->ts, NULL);
struct timeval tv;
memset(&tv, 0, sizeof(struct timeval));
gettimeofday(&tv, NULL);
p->ts = SCTIME_FROM_TIMEVAL(&tv);
}
p->datalink = DLT_RAW;

@ -6381,7 +6381,7 @@ static void StreamTcpPseudoPacketCreateDetectLogFlush(ThreadVars *tv,
}
/* use parent time stamp */
memcpy(&np->ts, &parent->ts, sizeof(struct timeval));
np->ts = parent->ts;
SCLogDebug("np %p", np);
PacketEnqueueNoLock(pq, np);

Loading…
Cancel
Save