detect: only apply ConfigApplyTx with app-layers

Ticket: 4972

Otherwise, it makes no sense to look for a tx...
pull/7112/head
Philippe Antoine 3 years ago committed by Victor Julien
parent e5838b8193
commit c3a220647b

@ -288,6 +288,10 @@ static int DetectConfigSetup (DetectEngineCtx *de_ctx, Signature *s, const char
fd->scope = CONFIG_SCOPE_TX; fd->scope = CONFIG_SCOPE_TX;
} }
if (fd->scope == CONFIG_SCOPE_TX) {
s->flags |= SIG_FLAG_APPLAYER;
}
sm->ctx = (SigMatchCtx*)fd; sm->ctx = (SigMatchCtx*)fd;
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_POSTMATCH); SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_POSTMATCH);

@ -33,6 +33,7 @@
#include "detect-dsize.h" #include "detect-dsize.h"
#include "detect-tcp-flags.h" #include "detect-tcp-flags.h"
#include "detect-flow.h" #include "detect-flow.h"
#include "detect-config.h"
#include "detect-flowbits.h" #include "detect-flowbits.h"
#include "util-profiling.h" #include "util-profiling.h"
@ -560,6 +561,13 @@ static int SignatureCreateMask(Signature *s)
case DETECT_ENGINE_EVENT: case DETECT_ENGINE_EVENT:
s->mask |= SIG_MASK_REQUIRE_ENGINE_EVENT; s->mask |= SIG_MASK_REQUIRE_ENGINE_EVENT;
break; break;
case DETECT_CONFIG: {
DetectConfigData *fd = (DetectConfigData *)sm->ctx;
if (fd->scope == CONFIG_SCOPE_FLOW) {
s->mask |= SIG_MASK_REQUIRE_FLOW;
}
break;
}
} }
} }

Loading…
Cancel
Save