From: Victor Julien Date: Fri, 28 Mar 2014 11:01:12 +0000 (+0100) Subject: af-packet: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2864f9eef97274f113bb92e91c844863e7d0f9d3;p=thirdparty%2Fsuricata.git af-packet: clean up decode thread local storage Clean up the thread local data of the decode part of afpacket. Bug #978 --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 0049c852c9..a83e21eb38 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -246,6 +246,7 @@ TmEcode ReceiveAFPThreadDeinit(ThreadVars *, void *); TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot); TmEcode DecodeAFPThreadInit(ThreadVars *, void *, void **); +TmEcode DecodeAFPThreadDeinit(ThreadVars *tv, void *data); TmEcode DecodeAFP(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); TmEcode AFPSetBPFFilter(AFPThreadVars *ptv); @@ -483,7 +484,7 @@ void TmModuleDecodeAFPRegister (void) { tmm_modules[TMM_DECODEAFP].ThreadInit = DecodeAFPThreadInit; tmm_modules[TMM_DECODEAFP].Func = DecodeAFP; tmm_modules[TMM_DECODEAFP].ThreadExitPrintStats = NULL; - tmm_modules[TMM_DECODEAFP].ThreadDeinit = NULL; + tmm_modules[TMM_DECODEAFP].ThreadDeinit = DecodeAFPThreadDeinit; tmm_modules[TMM_DECODEAFP].RegisterTests = NULL; tmm_modules[TMM_DECODEAFP].cap_flags = 0; tmm_modules[TMM_DECODEAFP].flags = TM_FLAG_DECODE_TM; @@ -1894,6 +1895,13 @@ TmEcode DecodeAFPThreadInit(ThreadVars *tv, void *initdata, void **data) SCReturnInt(TM_ECODE_OK); } +TmEcode DecodeAFPThreadDeinit(ThreadVars *tv, void *data) +{ + if (data != NULL) + DecodeThreadVarsFree(data); + SCReturnInt(TM_ECODE_OK); +} + #endif /* HAVE_AF_PACKET */ /* eof */ /**