]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer-detect-proto: use mpm-algo
authorJustin Viiret <justin.viiret@intel.com>
Mon, 23 May 2016 03:46:24 +0000 (13:46 +1000)
committerVictor Julien <victor@inliniac.net>
Fri, 27 May 2016 13:13:54 +0000 (15:13 +0200)
Use the matcher configured by the user rather than hard-coding MPM_AC.

src/app-layer-detect-proto.c

index c9b2a5e33eb90bf7d3c01f5bffe6183d62f6df4f..fb25b5b352092680a144eb6216051d8134cd0a97 100644 (file)
@@ -1528,6 +1528,8 @@ int AppLayerProtoDetectSetup(void)
     memset(&alpd_ctx, 0, sizeof(alpd_ctx));
 
     uint16_t spm_matcher = SinglePatternMatchDefaultMatcher();
+    uint16_t mpm_matcher = PatternMatchDefaultMatcher();
+
     alpd_ctx.spm_global_thread_ctx = SpmInitGlobalThreadCtx(spm_matcher);
     if (alpd_ctx.spm_global_thread_ctx == NULL) {
         SCLogError(SC_ERR_FATAL, "Unable to alloc SpmGlobalThreadCtx.");
@@ -1536,7 +1538,7 @@ int AppLayerProtoDetectSetup(void)
 
     for (i = 0; i < FLOW_PROTO_DEFAULT; i++) {
         for (j = 0; j < 2; j++) {
-            MpmInitCtx(&alpd_ctx.ctx_ipp[i].ctx_pm[j].mpm_ctx, MPM_AC);
+            MpmInitCtx(&alpd_ctx.ctx_ipp[i].ctx_pm[j].mpm_ctx, mpm_matcher);
         }
     }
     SCReturnInt(0);