From: Victor Julien Date: Fri, 10 Sep 2021 11:42:15 +0000 (+0200) Subject: detect/tests: improve detection entry X-Git-Tag: suricata-5.0.10~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7559%2Fhead;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 f63219bb7f..2b223b7579 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1645,11 +1645,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