From: Russ Combs (rucombs) Date: Mon, 20 Aug 2018 20:46:26 +0000 (-0400) Subject: Merge pull request #1336 in SNORT/snort3 from onload to master X-Git-Tag: 3.0.0-247~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eee103b9a6437763624954d152a9224b0aca08be;p=thirdparty%2Fsnort3.git Merge pull request #1336 in SNORT/snort3 from onload to master Squashed commit of the following: commit 256a612f39b3ad7ccdb5294e215d2383b1072ffc Author: Russ Combs (rucombs) Date: Fri Aug 17 14:41:34 2018 -0400 detection: avoid repeating detection by always doing non-fast-pattern rules immediately --- diff --git a/src/detection/fp_detect.cc b/src/detection/fp_detect.cc index b45c1a636..4b1486e54 100644 --- a/src/detection/fp_detect.cc +++ b/src/detection/fp_detect.cc @@ -90,13 +90,12 @@ THREAD_LOCAL ProfileStats ruleNFPEvalPerfStats; // every packet so this only sets the necessary counters to // zero which saves us time. -static inline void init_match_info(OtnxMatchData* o, bool do_fp) +static inline void init_match_info(OtnxMatchData* o) { for ( int i = 0; i < o->iMatchInfoArraySize; i++ ) o->matchInfo[i].iMatchCount = 0; o->have_match = false; - o->do_fp = do_fp; } // called by fpLogEvent(), which does the filtering etc. @@ -1004,16 +1003,13 @@ static inline int fpEvalHeaderSW(PortGroup* port_group, Packet* p, p->packet_flags &= ~PKT_IP_RULE; } - if ( omd->do_fp and DetectionEngine::content_enabled(p) ) + if ( DetectionEngine::content_enabled(p) ) { if ( fp->get_stream_insert() || !(p->packet_flags & PKT_STREAM_INSERT) ) if ( fp_search(port_group, p, check_ports, type, omd) ) return 0; } - if ( DetectionEngine::offloaded(p) ) - return 0; - do { if (port_group->nfp_rule_count) @@ -1286,7 +1282,7 @@ void fp_local(Packet* p) MpseStash* stash = c->stash; stash->enable_process(); stash->init(); - init_match_info(c->otnx, true); + init_match_info(c->otnx); fpEvalPacket(p); fpFinalSelectEvent(c->otnx, p); } @@ -1298,7 +1294,7 @@ void fp_offload(Packet* p) stash->enable_process(); stash->init(); stash->disable_process(); - init_match_info(c->otnx, true); + init_match_info(c->otnx); fpEvalPacket(p); } @@ -1308,7 +1304,6 @@ void fp_onload(Packet* p) MpseStash* stash = c->stash; stash->enable_process(); stash->process(rule_tree_match, c->otnx); - fpEvalPacket(p); fpFinalSelectEvent(c->otnx, p); }