]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fix nfq_get_timestamp
authornotnyt <nyt-github@countercultured.net>
Sat, 6 Feb 2016 00:11:03 +0000 (19:11 -0500)
committerVictor Julien <victor@inliniac.net>
Tue, 9 Feb 2016 13:27:26 +0000 (14:27 +0100)
Handle case when nfq_get_timestamp returns 0 for success, but timestamp is empty.

src/source-nfq.c

index 38770cb9708eb33a45335a4ac84cf5de0b847913..9b9e737600a6e6399e6083550a1ab84c64400b15 100644 (file)
@@ -473,7 +473,7 @@ int NFQSetupPkt (Packet *p, struct nfq_q_handle *qh, void *data)
     }
 
     ret = nfq_get_timestamp(tb, &p->ts);
-    if (ret != 0) {
+    if (ret != 0 || p->ts.tv_sec == 0) {
         memset (&p->ts, 0, sizeof(struct timeval));
         gettimeofday(&p->ts, NULL);
     }