From: Russ Combs Date: Tue, 11 Nov 2014 11:25:48 +0000 (-0500) Subject: fixed Inspector::tterm() calls X-Git-Tag: 3.0.0-233~1242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7d2fd33dabf4a855d465af25cbd3ba4c2172c97;p=thirdparty%2Fsnort3.git fixed Inspector::tterm() calls --- diff --git a/ChangeLog b/ChangeLog index b9e59fc1f..788ed430d 100644 --- 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 diff --git a/src/framework/inspector.h b/src/framework/inspector.h index 01fd1901d..3c7a8d7cd 100644 --- a/src/framework/inspector.h +++ b/src/framework/inspector.h @@ -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*) { }; diff --git a/src/managers/inspector_manager.cc b/src/managers/inspector_manager.cc index ff74191fe..7a73f3ab2 100644 --- a/src/managers/inspector_manager.cc +++ b/src/managers/inspector_manager.cc @@ -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; } } }