]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream-tcp: proper error if segment pool init fails 855/head
authorVictor Julien <victor@inliniac.net>
Wed, 26 Feb 2014 14:18:26 +0000 (15:18 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 26 Feb 2014 14:18:26 +0000 (15:18 +0100)
Until now a PoolInit failure for the segment pools would result in
an abort() through BUG_ON(). This patch adds a proper error message,
then exits.

Bug #1108.

src/stream-tcp-reassemble.c

index 4c9baaba52e9104fc5e7fd71ccf35193accbf490..386eb96ba256b47aebefd47b9a95ff0c2efdad67 100644 (file)
@@ -411,7 +411,12 @@ int StreamTcpReassemblyConfig(char quiet)
                 (void *) &my_segment_pktsizes[i],
                 TcpSegmentPoolCleanup, NULL);
         SCMutexUnlock(&my_segment_lock[i]);
-        BUG_ON(my_segment_pool[i] == NULL);
+
+        if (my_segment_pool[i] == NULL) {
+            SCLogError(SC_ERR_INITIALIZATION, "couldn't set up segment pool "
+                    "for packet size %u. Memcap too low?", my_segment_pktsizes[i]);
+            exit(EXIT_FAILURE);
+        }
 
         SCLogDebug("my_segment_pktsizes[i] %u, my_segment_poolsizes[i] %u",
                 my_segment_pktsizes[i], my_segment_poolsizes[i]);