From: Hui Cao (huica) Date: Wed, 14 Sep 2016 16:48:46 +0000 (-0400) Subject: Merge pull request #622 in SNORT/snort3 from tsc_update to master X-Git-Tag: 3.0.0-233~263^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a32fd2775eae108963b35d687042dafb13ecc55;p=thirdparty%2Fsnort3.git Merge pull request #622 in SNORT/snort3 from tsc_update to master Squashed commit of the following: commit 2cbdfa72cd6f09b8189465341e64ae7e2f1088df Author: Russ Combs Date: Wed Sep 14 11:19:43 2016 -0400 add missing usec conversions add hyperscan single match flag for optimization --- diff --git a/src/ips_options/ips_regex.cc b/src/ips_options/ips_regex.cc index 73e0e82c4..c5f765a69 100644 --- a/src/ips_options/ips_regex.cc +++ b/src/ips_options/ips_regex.cc @@ -253,6 +253,7 @@ RegexModule::~RegexModule() bool RegexModule::begin(const char*, int, SnortConfig*) { config.reset(); + config.pmd.flags |= HS_FLAG_SINGLEMATCH; return true; } diff --git a/src/latency/packet_latency.cc b/src/latency/packet_latency.cc index e770dca85..ebf12cc02 100644 --- a/src/latency/packet_latency.cc +++ b/src/latency/packet_latency.cc @@ -359,7 +359,7 @@ TEST_CASE ( "packet latency impl", "[latency]" ) CHECK_FALSE( impl.fastpath() ); CHECK( impl.pop(nullptr) ); - CHECK( event_handler.count == 0 ); + CHECK( event_handler.count == 1 ); CHECK( log_handler.count == 1 ); } diff --git a/src/profiler/rule_profiler.cc b/src/profiler/rule_profiler.cc index cfd7279d1..1d6eaf514 100644 --- a/src/profiler/rule_profiler.cc +++ b/src/profiler/rule_profiler.cc @@ -46,7 +46,7 @@ #include "catch/catch.hpp" #endif -#define s_rule_table_title "Rule Profile Statistics" +#define s_rule_table_title "rule profile" static inline OtnState& operator+=(OtnState& lhs, const OtnState& rhs) { @@ -228,17 +228,17 @@ static void print_single_entry(const View& v, unsigned n) table << n; // # table << v.sig_info.generator; // gid - table << v.sig_info.id; // sid - table << v.sig_info.rev; // rev + table << v.sig_info.id; // sid + table << v.sig_info.rev; - table << v.checks(); // checks - table << v.matches(); // matches - table << v.alerts(); // alerts + table << v.checks(); + table << v.matches(); + table << v.alerts(); - table << duration_cast(v.elapsed()).count(); // time - table << duration_cast(v.avg_check()).count(); // avg/check - table << duration_cast(v.avg_match()).count(); // avg/match - table << duration_cast(v.avg_no_match()).count(); // avg/non-match + table << clock_usecs(duration_cast(v.elapsed()).count()); + table << clock_usecs(duration_cast(v.avg_check()).count()); + table << clock_usecs(duration_cast(v.avg_match()).count()); + table << clock_usecs(duration_cast(v.avg_no_match()).count()); table << v.timeouts(); table << v.suspends(); diff --git a/src/profiler/time_profiler.cc b/src/profiler/time_profiler.cc index fdcd693db..b0e0f4ed7 100644 --- a/src/profiler/time_profiler.cc +++ b/src/profiler/time_profiler.cc @@ -134,7 +134,7 @@ static void print_fn(StatsTable& t, const View& v) t << clock_usecs(duration_cast(v.elapsed()).count()); // avg/check - t << duration_cast(v.avg_check()).count(); + t << clock_usecs(duration_cast(v.avg_check()).count()); } } // namespace time_stats diff --git a/src/search_engines/hyperscan.cc b/src/search_engines/hyperscan.cc index 724756f36..84c33e68d 100644 --- a/src/search_engines/hyperscan.cc +++ b/src/search_engines/hyperscan.cc @@ -207,7 +207,7 @@ int HyperscanMpse::prep_patterns(SnortConfig* sc) for ( auto& p : pvector ) { pats.push_back(p.pat.c_str()); - flags.push_back(p.flags); + flags.push_back(p.flags | HS_FLAG_SINGLEMATCH); ids.push_back(id++); }