]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Exit if BPF filter file is specified in IPS mode
authorEric Leblond <eric@regit.org>
Wed, 26 Feb 2014 10:13:33 +0000 (11:13 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Mar 2014 09:16:39 +0000 (10:16 +0100)
This patch adds a check that was missing when specifying BPF filter
from a file. Suricata behavior should have been the same as when
BPF filter is specified on command line.

src/suricata.c

index 9bf971df37a825e0276b568ff22e8b44d034caa4..d28b69d666c726fc3b1660ab5650354dbabc0c90 100644 (file)
@@ -423,6 +423,13 @@ static void SetBpfStringFromFile(char *filename) {
     FILE *fp = NULL;
     size_t nm = 0;
 
+    if (IS_ENGINE_MODE_IPS(engine_mode)) {
+        SCLogError(SC_ERR_NOT_SUPPORTED,
+                   "BPF filter not available in IPS mode."
+                   " Use firewall filtering if possible.");
+        exit(EXIT_FAILURE);
+    }
+
 #ifdef OS_WIN32
     if(_stat(filename, &st) != 0) {
 #else