From: rcombs Date: Wed, 14 Jan 2015 18:09:03 +0000 (-0500) Subject: fix active rule actions X-Git-Tag: 3.0.0-233~1082^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b611aa1790e77813c0e8fcb2b76d2d6e659eb5d7;p=thirdparty%2Fsnort3.git fix active rule actions --- diff --git a/src/managers/action_manager.cc b/src/managers/action_manager.cc index d3bae6654..92c316abe 100644 --- a/src/managers/action_manager.cc +++ b/src/managers/action_manager.cc @@ -54,14 +54,22 @@ static THREAD_LOCAL IpsAction* s_action = nullptr; void ActionManager::add_plugin(const ActionApi* api) { Actor a(api); + + if ( api->pinit ) + api->pinit(); + s_actors.push_back(a); } void ActionManager::release_plugins() { for ( auto& p : s_actors ) + { p.api->dtor(p.act); + if ( p.api->pterm ) + p.api->pterm(); + } s_actors.clear(); } diff --git a/src/packet_io/active.cc b/src/packet_io/active.cc index edb80befb..c95405423 100644 --- a/src/packet_io/active.cc +++ b/src/packet_io/active.cc @@ -50,11 +50,8 @@ THREAD_LOCAL int active_drop_ssn = 0; THREAD_LOCAL int active_tunnel_bypass = 0; THREAD_LOCAL int active_suspend = 0; - THREAD_LOCAL int active_have_rsp = 0; -static THREAD_LOCAL uint64_t s_injects = 0; - typedef int (*send_t) ( const DAQ_PktHdr_t* h, int rev, const uint8_t* buf, uint32_t len); @@ -62,9 +59,10 @@ static THREAD_LOCAL eth_t* s_link = NULL; static THREAD_LOCAL ip_t* s_ipnet = NULL; static THREAD_LOCAL send_t s_send = DAQ_Inject; -// FIXIT-L these should not have to be thread local static THREAD_LOCAL uint8_t s_attempts = 0; -static THREAD_LOCAL int s_enabled = 0; +static THREAD_LOCAL uint64_t s_injects = 0; + +static int s_enabled = 0; static int Active_Open(const char*); static int Active_Close(void); diff --git a/src/parser/parse_rule.cc b/src/parser/parse_rule.cc index 1e958e8ee..44b1fb2a3 100644 --- a/src/parser/parse_rule.cc +++ b/src/parser/parse_rule.cc @@ -1343,7 +1343,6 @@ void parse_rule_type(SnortConfig* sc, const char* s, RuleTreeNode& rtn) } else { - s = get_action_string(rtn.type); rtn.listhead = get_rule_list(sc, s); }