From: Victor Julien Date: Thu, 29 Jan 2015 15:40:23 +0000 (+0100) Subject: detect: use multi tenant thread init if MT enabled X-Git-Tag: suricata-3.0RC1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98d265f40b63538ca2c15996d0fda1f1e6cb8644;p=thirdparty%2Fsuricata.git detect: use multi tenant thread init if MT enabled --- diff --git a/src/detect-engine.c b/src/detect-engine.c index 61c7409228..4e167f0613 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1350,6 +1350,12 @@ static TmEcode ThreadCtxDoInit (DetectEngineCtx *de_ctx, DetectEngineThreadCtx * */ TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data) { + if (DetectEngineMultiTenantEnabled()) { + DetectEngineThreadCtx *mt_det_ctx = DetectEngineThreadCtxInitForMT(tv); + *data = (void *)mt_det_ctx; + return (mt_det_ctx == NULL) ? TM_ECODE_FAILED : TM_ECODE_OK; + } + /* first register the counter. In delayed detect mode we exit right after if the * rules haven't been loaded yet. */ uint16_t counter_alerts = StatsRegisterCounter("detect.alert", tv);