]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed Inspector::tterm() calls
authorRuss Combs <rucombs@cisco.com>
Tue, 11 Nov 2014 11:25:48 +0000 (06:25 -0500)
committerRuss Combs <rucombs@cisco.com>
Tue, 11 Nov 2014 11:25:48 +0000 (06:25 -0500)
ChangeLog
src/framework/inspector.h
src/managers/inspector_manager.cc

index b9e59fc1fc9376a0b414b68176e88cfb9bbc81fd..788ed430dc91e5b3a83cb97b235de4d67b0e3092 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
 -- fix null flow_con in print mode
 -- fixed udp session timeout counting
 -- patched around shutdown issue after reload
+-- fixed calls to Inspector::tterm()
 
 127
 -- REG_TEST out logging tcp options for rebuilt packets to match snort bug
index 01fd1901deaa8593e14edeb2fc4de8f2c2fd2d84..3c7a8d7cdd9ce237a0c26d463ac2edcd8f25e19b 100644 (file)
@@ -67,8 +67,9 @@ public:
     virtual void show(SnortConfig*) { };
 
     // packet thread functions
-    virtual void tinit() { };
-    virtual void tterm() { };
+    // tinit, tterm called on default policy instance only
+    virtual void tinit() { };  // allocate configurable thread local
+    virtual void tterm() { };  // purge only, deallocate via api
 
     virtual void eval(Packet*) = 0;
     virtual void meta(int, const uint8_t*) { };
index ff74191fe0ce9ca4227ad7d6820890a9e43539da..7a73f3ab2e23530bcfe1589dbb993e8e0cc32700 100644 (file)
@@ -72,9 +72,10 @@ struct PHClass
 {
     const InspectApi& api;
     bool init;  // call pin->tinit()
+    bool term;  // call pin->tterm()
 
     PHClass(const InspectApi& p) : api(p)
-    { init = true; };
+    { init = term = true; };
 
     static bool comp (PHClass* a, PHClass* b)
     { return ( a->api.type < b->api.type ); };
@@ -493,12 +494,10 @@ void InspectorManager::thread_stop(SnortConfig*)
     if ( pi && pi->framework_policy )
     {
         for ( auto* p : pi->framework_policy->ilist )
-            // FIXIT-H init set after reload preventing call to
-            // StreamBase::tterm() which is bad, m'kay?
-            //if ( !p->pp_class.init )
+            if ( p->pp_class.term )
             {
                 p->handler->tterm();
-                p->pp_class.init = true;
+                p->pp_class.term = false;
             }
     }
 }