From 537fb7a1c60469f1fddf7bfdd90369213e8a2910 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Wed, 1 Jul 2020 17:29:01 +0530 Subject: [PATCH] hyperscan: better error message if not compiled --- src/detect-engine-mpm.c | 6 ++++++ src/util-spm.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 009aeea004..6619d35f3f 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -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); diff --git a/src/util-spm.c b/src/util-spm.c index 17bc1139e0..1cdbdd6848 100644 --- a/src/util-spm.c +++ b/src/util-spm.c @@ -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\"",