From: Eric Leblond Date: Fri, 2 Nov 2012 08:05:56 +0000 (+0100) Subject: nfq: suppress non loop receive function X-Git-Tag: suricata-1.4beta3~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3a38810b6f098f8bd15d843f726b05c40168fcb;p=thirdparty%2Fsuricata.git nfq: suppress non loop receive function --- diff --git a/src/source-nfq.c b/src/source-nfq.c index 8120c7cc99..03f48fa502 100644 --- a/src/source-nfq.c +++ b/src/source-nfq.c @@ -137,7 +137,6 @@ static NFQQueueVars nfq_q[NFQ_MAX_QUEUE]; static uint16_t receive_queue_num = 0; static SCMutex nfq_init_lock; -TmEcode ReceiveNFQ(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); TmEcode ReceiveNFQLoop(ThreadVars *tv, void *data, void *slot); TmEcode ReceiveNFQThreadInit(ThreadVars *, void *, void **); TmEcode ReceiveNFQThreadDeinit(ThreadVars *, void *); @@ -175,7 +174,7 @@ void TmModuleReceiveNFQRegister (void) { tmm_modules[TMM_RECEIVENFQ].name = "ReceiveNFQ"; tmm_modules[TMM_RECEIVENFQ].ThreadInit = ReceiveNFQThreadInit; - tmm_modules[TMM_RECEIVENFQ].Func = ReceiveNFQ; + tmm_modules[TMM_RECEIVENFQ].Func = NULL; tmm_modules[TMM_RECEIVENFQ].PktAcqLoop = ReceiveNFQLoop; tmm_modules[TMM_RECEIVENFQ].ThreadExitPrintStats = ReceiveNFQThreadExitStats; tmm_modules[TMM_RECEIVENFQ].ThreadDeinit = ReceiveNFQThreadDeinit; @@ -855,32 +854,6 @@ TmEcode ReceiveNFQLoop(ThreadVars *tv, void *data, void *slot) SCReturnInt(TM_ECODE_OK); } -/** - * \brief NFQ receive module main entry function: receive a packet from NFQ - */ -TmEcode ReceiveNFQ(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postpq) { - - NFQThreadVars *ntv = (NFQThreadVars *)data; - NFQQueueVars *nq = NFQGetQueue(ntv->nfq_index); - if (nq == NULL) { - SCLogWarning(SC_ERR_INVALID_ARGUMENT, - "can't get queue for %" PRId16 "", ntv->nfq_index); - return TM_ECODE_FAILED; - } - - /* make sure we have at least one packet in the packet pool, to prevent - * us from 1) alloc'ing packets at line rate, 2) have a race condition - * for the nfq mutex lock with the verdict thread. */ - while (PacketPoolSize() == 0) { - PacketPoolWait(); - } - - /* do our nfq magic */ - NFQRecvPkt(nq, ntv); - - return TM_ECODE_OK; -} - /** * \brief NFQ receive module stats printing function */