]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
hyperscan: better error message if not compiled
authorShivani Bhardwaj <shivanib134@gmail.com>
Wed, 1 Jul 2020 11:59:01 +0000 (17:29 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jul 2020 13:31:41 +0000 (15:31 +0200)
src/detect-engine-mpm.c
src/util-spm.c

index 009aeea0045589ad2ed6245f83b3409c57dc4555..6619d35f3f9c4543d11b59fb00603cf93709bf1d 100644 (file)
@@ -643,6 +643,12 @@ uint16_t PatternMatchDefaultMatcher(void)
             }
         }
 
+#ifndef BUILD_HYPERSCAN
+    if ((mpm_algo != NULL) && (strcmp(mpm_algo, "hs") == 0)) {
+        FatalError(SC_ERR_INVALID_VALUE, "Hyperscan (hs) support for mpm-algo is "
+                   "not compiled into Suricata.");
+    }
+#endif
         SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "Invalid mpm algo supplied "
                 "in the yaml conf file: \"%s\"", mpm_algo);
         exit(EXIT_FAILURE);
index 17bc1139e0edc9b89e0aea899d07947f31ec3e05..1cdbdd6848d655509e26e4fb08de00a18b512cf4 100644 (file)
@@ -83,6 +83,12 @@ uint16_t SinglePatternMatchDefaultMatcher(void)
             }
         }
 
+#ifndef BUILD_HYPERSCAN
+        if ((spm_algo != NULL) && (strcmp(spm_algo, "hs") == 0)) {
+            FatalError(SC_ERR_INVALID_VALUE, "Hyperscan (hs) support for spm-algo is "
+                       "not compiled into Suricata.");
+        }
+#endif
         SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY,
                    "Invalid spm algo supplied "
                    "in the yaml conf file: \"%s\"",