]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/tests: improve detection entry 7544/head
authorVictor Julien <victor@inliniac.net>
Fri, 10 Sep 2021 11:42:15 +0000 (13:42 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 14 Jun 2022 19:12:48 +0000 (21:12 +0200)
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)

src/detect.c

index b8d480e197eff50cc17dd8a7f5e71dc9f634f48a..b57d3aa7a18cceaf03bcfb4025a21044c11d1b6a 100644 (file)
@@ -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