From: Victor Julien Date: Tue, 10 Oct 2017 10:40:03 +0000 (+0200) Subject: detect/prefilter: show prefilter engine id space X-Git-Tag: suricata-4.1.0-beta1~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d9ade9c351c736e24e2fb4b67cbe63756c04cd8;p=thirdparty%2Fsuricata.git detect/prefilter: show prefilter engine id space --- diff --git a/src/detect-engine-prefilter.c b/src/detect-engine-prefilter.c index 380ea87568..11461b33cf 100644 --- a/src/detect-engine-prefilter.c +++ b/src/detect-engine-prefilter.c @@ -112,7 +112,7 @@ void DetectRunPrefilterTx(DetectEngineThreadCtx *det_ctx, if (engine->tx_min_progress > tx->tx_progress) goto next; if (tx->tx_progress > engine->tx_min_progress) { - if (tx->prefilter_flags & (1<<(engine->id))) { + if (tx->prefilter_flags & (1<<(engine->local_id))) { goto next; } } @@ -123,7 +123,7 @@ void DetectRunPrefilterTx(DetectEngineThreadCtx *det_ctx, PROFILING_PREFILTER_END(p, engine->gid); if (tx->tx_progress > engine->tx_min_progress) { - tx->prefilter_flags |= (1<<(engine->id)); + tx->prefilter_flags |= (1<<(engine->local_id)); } next: if (engine->is_last) @@ -381,7 +381,7 @@ void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh) PrefilterEngine *e = sgh->pkt_engines; for (el = sgh->init->pkt_engines ; el != NULL; el = el->next) { - e->id = el->id; + e->local_id = el->id; e->cb.Prefilter = el->Prefilter; e->pectx = el->pectx; el->pectx = NULL; // e now owns the ctx @@ -406,7 +406,7 @@ void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh) PrefilterEngine *e = sgh->payload_engines; for (el = sgh->init->payload_engines ; el != NULL; el = el->next) { - e->id = el->id; + e->local_id = el->id; e->cb.Prefilter = el->Prefilter; e->pectx = el->pectx; el->pectx = NULL; // e now owns the ctx @@ -429,9 +429,10 @@ void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh) } memset(sgh->tx_engines, 0x00, (cnt * sizeof(PrefilterEngine))); + uint32_t local_id = 0; PrefilterEngine *e = sgh->tx_engines; for (el = sgh->init->tx_engines ; el != NULL; el = el->next) { - e->id = el->id; + e->local_id = local_id++; e->alproto = el->alproto; e->tx_min_progress = el->tx_min_progress; e->cb.PrefilterTx = el->PrefilterTx; @@ -443,6 +444,7 @@ void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh) } e++; } + SCLogDebug("sgh %p max local_id %u", sgh, local_id); } } diff --git a/src/detect.h b/src/detect.h index f260732445..a66edf7a51 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1072,7 +1072,7 @@ typedef struct PrefilterEngineList_ { } PrefilterEngineList; typedef struct PrefilterEngine_ { - uint16_t id; + uint16_t local_id; /** App Proto this engine applies to: only used with Tx Engines */ AppProto alproto;