]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fix active rule actions
authorrcombs <rcombs@sq18.sfeng.sourcefire.com>
Wed, 14 Jan 2015 18:09:03 +0000 (13:09 -0500)
committerrcombs <rcombs@sq18.sfeng.sourcefire.com>
Wed, 14 Jan 2015 18:09:03 +0000 (13:09 -0500)
src/managers/action_manager.cc
src/packet_io/active.cc
src/parser/parse_rule.cc

index d3bae665466bf6db916fa5dc41f350fef00f35e5..92c316abe96c80c91569f3f3b1546aa009931ed4 100644 (file)
@@ -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();
 }
 
index edb80befbb69165ca49a43281a782bd049c3f188..c95405423bbb141e37feb0203659bb6d9725e474 100644 (file)
@@ -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);
index 1e958e8eeeb8620847a3778b53cbb9cc7cb1a286..44b1fb2a3c42359175b54bce554515bc75e9d52f 100644 (file)
@@ -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);
     }