From: Victor Julien Date: Tue, 31 May 2016 14:58:29 +0000 (+0200) Subject: ac-ks: don't allow use on big-endian X-Git-Tag: suricata-3.1RC1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=371113e21e808b74cfbb0878ed14e08a3b926d5c;p=thirdparty%2Fsuricata.git ac-ks: don't allow use on big-endian --- diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index fe469b4a08..dafa2b3a8b 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -335,6 +335,13 @@ uint16_t PatternMatchDefaultMatcher(void) uint16_t u; if (mpm_algo != NULL) { +#if __BYTE_ORDER == __BIG_ENDIAN + if (strcmp(mpm_algo, "ac-ks") == 0) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "ac-ks does " + "not work on big endian systems at this time."); + exit(EXIT_FAILURE); + } +#endif if (strcmp("auto", mpm_algo) == 0) { goto done; } diff --git a/src/util-mpm-ac-tile.c b/src/util-mpm-ac-tile.c index 425d223766..62fda87e10 100644 --- a/src/util-mpm-ac-tile.c +++ b/src/util-mpm-ac-tile.c @@ -68,6 +68,8 @@ #include "suricata-common.h" #include "suricata.h" +#if __BYTE_ORDER == __LITTLE_ENDIAN + #include "detect.h" #include "detect-parse.h" #include "detect-engine.h" @@ -2569,3 +2571,11 @@ void SCACTileRegisterTests(void) #endif } +#else /* we're big endian */ + +void MpmACTileRegister(void) +{ + /* no-op on big endian */ +} + +#endif /* little endian check */