From: Michael Altizer (mialtize) Date: Mon, 9 Jul 2018 16:42:29 +0000 (-0400) Subject: Merge pull request #1286 in SNORT/snort3 from offload_crash to master X-Git-Tag: 3.0.0-246~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0ca226cf0bcf5077a2c6b78e2cd2cf7d7af71b4;p=thirdparty%2Fsnort3.git Merge pull request #1286 in SNORT/snort3 from offload_crash to master Squashed commit of the following: commit 53d14ee1015a9df4b133589bece240fb39d84179 Author: Carter Waxman Date: Mon Jul 2 17:07:55 2018 -0400 detection: don't offload when 0 threads are configured --- diff --git a/src/detection/detection_engine.cc b/src/detection/detection_engine.cc index 599ab8a59..27ef5ab40 100644 --- a/src/detection/detection_engine.cc +++ b/src/detection/detection_engine.cc @@ -297,8 +297,10 @@ bool DetectionEngine::offload(Packet* p) { ContextSwitcher* sw = Snort::get_switcher(); - if ( p->type() != PktType::PDU or (p->dsize < SnortConfig::get_conf()->offload_limit) or - !sw->can_hold() ) + if ( p->type() != PktType::PDU or + p->dsize < SnortConfig::get_conf()->offload_limit or + !sw->can_hold() or + !offloader->available() ) { fp_local(p); return false; diff --git a/src/detection/regex_offload.h b/src/detection/regex_offload.h index 1802daab2..e12d21942 100644 --- a/src/detection/regex_offload.h +++ b/src/detection/regex_offload.h @@ -49,6 +49,9 @@ public: void stop(); + unsigned available() + { return idle.size(); } + unsigned count() { return busy.size(); }