From 6943a7eb8ce5cb0f92e2d762eeeb27e7d3d3d125 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 13 Dec 2010 17:03:46 +0100 Subject: [PATCH] Move updating the time from the pcap callback to the decoding stage in file mode. --- src/source-pcap-file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/source-pcap-file.c b/src/source-pcap-file.c index 0575d522df..04f27a58c4 100644 --- a/src/source-pcap-file.c +++ b/src/source-pcap-file.c @@ -129,7 +129,6 @@ void PcapFileCallback(char *user, struct pcap_pkthdr *h, u_char *pkt) { p->ts.tv_sec = h->ts.tv_sec; p->ts.tv_usec = h->ts.tv_usec; SCLogDebug("p->ts.tv_sec %"PRIuMAX"", (uintmax_t)p->ts.tv_sec); - TimeSet(&p->ts); p->datalink = pcap_g.datalink; ptv->pkts++; @@ -317,6 +316,10 @@ TmEcode DecodePcapFile(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, P SCPerfCounterAddUI64(dtv->counter_avg_pkt_size, tv->sc_perf_pca, p->pktlen); SCPerfCounterSetUI64(dtv->counter_max_pkt_size, tv->sc_perf_pca, p->pktlen); + /* update the engine time representation based on the timestamp + * of the packet. */ + TimeSet(&p->ts); + /* call the decoder */ pcap_g.Decoder(tv, dtv, p, p->pkt, p->pktlen, pq);