From: Victor Julien Date: Fri, 28 Mar 2014 11:14:04 +0000 (+0100) Subject: pfring: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=900fc6fdc7d56a426bf60a8eaada45c83c5e2f7a;p=thirdparty%2Fsuricata.git pfring: clean up decode thread local storage Clean up the thread local data the decode portion of pfring uses. Bug #978 --- diff --git a/src/source-pfring.c b/src/source-pfring.c index 44c91cc61f..34eff68912 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -68,6 +68,7 @@ TmEcode ReceivePfringThreadDeinit(ThreadVars *, void *); TmEcode DecodePfringThreadInit(ThreadVars *, void *, void **); TmEcode DecodePfring(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); +TmEcode DecodePfringThreadDeinit(ThreadVars *tv, void *data); extern int max_pending_packets; extern uint8_t suricata_ctl_flags; @@ -183,7 +184,7 @@ void TmModuleDecodePfringRegister (void) { tmm_modules[TMM_DECODEPFRING].ThreadInit = DecodePfringThreadInit; tmm_modules[TMM_DECODEPFRING].Func = DecodePfring; tmm_modules[TMM_DECODEPFRING].ThreadExitPrintStats = NULL; - tmm_modules[TMM_DECODEPFRING].ThreadDeinit = NULL; + tmm_modules[TMM_DECODEPFRING].ThreadDeinit = DecodePfringThreadDeinit; tmm_modules[TMM_DECODEPFRING].RegisterTests = NULL; tmm_modules[TMM_DECODEPFRING].flags = TM_FLAG_DECODE_TM; } @@ -662,5 +663,14 @@ TmEcode DecodePfringThreadInit(ThreadVars *tv, void *initdata, void **data) return TM_ECODE_OK; } + +TmEcode DecodePfringThreadDeinit(ThreadVars *tv, void *data) +{ + if (data != NULL) + DecodeThreadVarsFree(data); + SCReturnInt(TM_ECODE_OK); +} + + #endif /* HAVE_PFRING */ /* eof */