]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1156 in SNORT/snort3 from active_reset to master
authorHui Cao (huica) <huica@cisco.com>
Thu, 22 Mar 2018 20:22:35 +0000 (16:22 -0400)
committerHui Cao (huica) <huica@cisco.com>
Thu, 22 Mar 2018 20:22:35 +0000 (16:22 -0400)
Squashed commit of the following:

commit 65428423fd6ccd4a67493276437fb780b4f3c55f
Author: huica <huica@cisco.com>
Date:   Thu Mar 22 13:04:15 2018 -0400

    Add reject action when active responses is enabled

commit ac060b64caec2597930f7197b8a39a59f24d4151
Author: huica <huica@cisco.com>
Date:   Thu Mar 22 10:58:40 2018 -0400

    Enable active when max_responses is enabled

src/packet_io/active.cc
tools/snort2lua/preprocessor_states/pps_stream5_global.cc

index 029716ff9c4528f38970f6c17d9a53bb20e6d8ac..233a0a9638f3f0d329403662847775678ed30055 100644 (file)
@@ -179,6 +179,10 @@ bool Active::init(SnortConfig* sc)
 #endif
         }
     }
+
+    if (sc->max_responses > 0)
+        Active::set_enabled();
+
     return true;
 }
 
index c66dabd0d8ff14fa3df3d5f0dc4f848163606b0f..99c98135da1afba14402080f37672c42c0c74d18 100644 (file)
@@ -160,6 +160,9 @@ bool StreamGlobal::convert(std::istringstream& data_stream)
             table_api.add_diff_option_comment("max_active_responses","max_responses");
             tmpval = parse_int_option("max_responses", arg_stream, false);
             table_api.close_table();
+            table_api.open_top_level_table("reject");
+            table_api.add_option("reset", "both");
+            table_api.close_table();
         }
         else
         {