From: Victor Julien Date: Fri, 10 Sep 2021 11:42:15 +0000 (+0200) Subject: detect/tests: improve detection entry X-Git-Tag: suricata-6.0.6~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a32b02fb65a04355ce7bf49cd4ab77ec50774961;p=thirdparty%2Fsuricata.git detect/tests: improve detection entry Lots of tests still use SigMatchSignatures as their main detection entry function, which bypassed some logic. Make it match main logic more closely. (cherry picked from commit e36b9b89a1be5b45b6e071248a17208b617b0c71) --- diff --git a/src/detect.c b/src/detect.c index b8d480e197..b57d3aa7a1 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1661,11 +1661,14 @@ void DisableDetectFlowFileFlags(Flow *f) /** * \brief wrapper for old tests */ -void SigMatchSignatures(ThreadVars *th_v, - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Packet *p) +void SigMatchSignatures( + ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p) { - DetectRun(th_v, de_ctx, det_ctx, p); + if (p->flow) { + DetectFlow(tv, de_ctx, det_ctx, p); + } else { + DetectNoFlow(tv, de_ctx, det_ctx, p); + } } #endif