]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ac-ks: don't allow use on big-endian
authorVictor Julien <victor@inliniac.net>
Tue, 31 May 2016 14:58:29 +0000 (16:58 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 1 Jun 2016 08:44:30 +0000 (10:44 +0200)
src/detect-engine-mpm.c
src/util-mpm-ac-tile.c

index fe469b4a08a23e5da6c86b38d2d29387bbaedc76..dafa2b3a8bcda07a3e20c6a9fb9f0df944124af8 100644 (file)
@@ -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;
             }
index 425d2237666421aa6c73499cf537e25b367b395b..62fda87e106ceb5928372dfb410c23cb88e9fbe4 100644 (file)
@@ -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 */