]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fix for #925.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Sun, 1 Sep 2013 10:14:52 +0000 (15:44 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Sep 2013 15:55:10 +0000 (17:55 +0200)
Log sensible error message when the user doesn't supply a value for
stream.prealloc-sessions or when the values supplied in invalid and
the engine resorts to using a default.

src/stream-tcp.c

index a4b5cb14bb33a65a2cbfec66d517371e28baf206..b9442bf31cfe531093dc0c6d7eaafe5fed96ca84 100644 (file)
@@ -347,10 +347,16 @@ void StreamTcpInitConfig(char quiet)
     if ((ConfGetInt("stream.prealloc-sessions", &value)) == 1) {
         stream_config.prealloc_sessions = (uint32_t)value;
     } else {
-        if (RunmodeIsUnittests())
+        if (RunmodeIsUnittests()) {
             stream_config.prealloc_sessions = 128;
-        else
+        } else {
             stream_config.prealloc_sessions = STREAMTCP_DEFAULT_PREALLOC;
+            if (ConfGetNode("stream.prealloc-sessions") != NULL) {
+                WarnInvalidConfEntry("stream.prealloc_sessions",
+                                     "%"PRIu32,
+                                     stream_config.prealloc_sessions);
+            }
+        }
     }
     if (!quiet) {
         SCLogInfo("stream \"prealloc-sessions\": %"PRIu32" (per thread)",