From e1468107e57e8c54f257175d671f76b9e32d15f2 Mon Sep 17 00:00:00 2001 From: Andreas Herz Date: Thu, 25 Feb 2016 21:33:36 +0100 Subject: [PATCH] nfqueue: fix wrong return value check in error cases 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source-nfq.c b/src/source-nfq.c index 9b9e737600..34c3734f01 100644 --- a/src/source-nfq.c +++ b/src/source-nfq.c @@ -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); -- 2.47.2