From 1a726731e419425d87f7035d9c06687d625f9126 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Sun, 3 May 2020 08:55:37 -0400 Subject: [PATCH] detect: Use byte-math to byte var handling func --- src/detect-byte.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/detect-byte.c b/src/detect-byte.c index 1fb2170b6e..a1560aac23 100644 --- a/src/detect-byte.c +++ b/src/detect-byte.c @@ -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; }