]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nflog: warn if buffer-size is larger than max-size
authorVictor Julien <victor@inliniac.net>
Mon, 26 May 2014 10:40:50 +0000 (12:40 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 26 May 2014 10:40:50 +0000 (12:40 +0200)
If buffer-size is larger than max size, give a warning and adjust
buffer-size to max-size.

src/runmode-nflog.c

index 15628f19a07472af9145fd6cf0c3b247b2a8d409..17725622b5e89faf60ba4935625ddf4e9ebc116a 100644 (file)
@@ -132,6 +132,12 @@ void *ParseNflogConfig(const char *group)
         return NULL;
     }
 
+    if (nflogconf->nlbufsiz > nflogconf->nlbufsiz_max) {
+        SCLogWarning(SC_ERR_INVALID_ARGUMENT, "buffer-size value larger "
+                "than max-size value, adjusting buffer-size");
+        nflogconf->nlbufsiz = nflogconf->nlbufsiz_max;
+    }
+
     boolval = ConfGetChildValueIntWithDefault(group_root, group_default,
                                               "qthreshold", &qthreshold);