]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: clean up decode thread local storage
authorVictor Julien <victor@inliniac.net>
Fri, 28 Mar 2014 11:14:04 +0000 (12:14 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 2 Apr 2014 11:13:52 +0000 (13:13 +0200)
Clean up the thread local data the decode portion of pfring uses.

Bug #978

src/source-pfring.c

index 44c91cc61fcd21095ff69e4db89075abf1491397..34eff68912b26ca193c3ec28a620242177f9adec 100644 (file)
@@ -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 */