]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Bug #510. Produce error if max-pending-packets is higher than 65534. origin/HEAD origin/master
authorVictor Julien <victor@inliniac.net>
Thu, 9 Aug 2012 14:59:49 +0000 (16:59 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 9 Aug 2012 14:59:49 +0000 (16:59 +0200)
src/suricata.c

index 29e715c1af518b16398e2e83a04f07b332f04307..0ae37194525b1bf059ee4df2651c75b4661327f5 100644 (file)
@@ -1326,6 +1326,13 @@ int main(int argc, char **argv)
      * back on a sane default. */
     if (ConfGetInt("max-pending-packets", &max_pending_packets) != 1)
         max_pending_packets = DEFAULT_MAX_PENDING_PACKETS;
+    if (max_pending_packets >= 65535) {
+        SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY,
+                "Maximum max-pending-packets setting is 65534. "
+                "Please check %s for errors", conf_filename);
+        exit(EXIT_FAILURE);
+    }
+
     SCLogDebug("Max pending packets set to %"PRIiMAX, max_pending_packets);
 
     /* Pull the default packet size from the config, if not found fall