]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: Use byte-math to byte var handling func
authorJeff Lucovsky <jeff@lucovsky.org>
Sun, 3 May 2020 12:55:37 +0000 (08:55 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 11 Jul 2020 06:36:52 +0000 (08:36 +0200)
src/detect-byte.c

index 1fb2170b6e9075ff236241172d38c25ec9ef4291..a1560aac238ad49eb02034227dde20a03127d3ec 100644 (file)
@@ -24,6 +24,7 @@
 #include "suricata-common.h"
 #include "detect-byte.h"
 #include "detect-byte-extract.h"
+#include "detect-bytemath.h"
 
 /**
  * \brief Used to retrieve args from BM.
@@ -43,5 +44,10 @@ bool DetectByteRetrieveSMVar(const char *arg, const Signature *s, DetectByteInde
         return true;
     }
 
+    SigMatch *bmd_sm = DetectByteMathRetrieveSMVar(arg, s);
+    if (bmd_sm != NULL) {
+        *index = ((DetectByteMathData *)bmd_sm->ctx)->local_id;
+        return true;
+    }
     return false;
 }