]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nfqueue: fix wrong return value check in error cases 1883/head
authorAndreas Herz <andi@geekosphere.org>
Thu, 25 Feb 2016 20:33:36 +0000 (21:33 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 26 Feb 2016 09:03:26 +0000 (10:03 +0100)
The check for the return value was wrong, we have 0 for success and 1
(and 2) for the error cases like TM_ECODE_FAILED, so we should quit
unless TM_ECODE_OK (0) is returned for NFQInitThread. This fixes #1870

src/source-nfq.c

index 9b9e737600a6e6399e6083550a1ab84c64400b15..34c3734f017010fb2ae741bbe882cb8f9651ac04 100644 (file)
@@ -709,7 +709,7 @@ TmEcode ReceiveNFQThreadInit(ThreadVars *tv, void *initdata, void **data)
     ntv->tv = tv;
 
     int r = NFQInitThread(ntv, (max_pending_packets * NFQ_BURST_FACTOR));
-    if (r < 0) {
+    if (r != TM_ECODE_OK) {
         SCLogError(SC_ERR_NFQ_THREAD_INIT, "nfq thread failed to initialize");
 
         SCMutexUnlock(&nfq_init_lock);