From: Andreas Herz Date: Thu, 25 Feb 2016 20:33:36 +0000 (+0100) Subject: nfqueue: fix wrong return value check in error cases X-Git-Tag: suricata-3.0.1RC1~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1883%2Fhead;p=thirdparty%2Fsuricata.git 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 --- 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);