From b1b4cd2729ea41ad72427c6678021deeccb77f89 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 24 Jul 2012 14:14:43 +0200 Subject: [PATCH] defrag: really use 'max-frags' variable. The 'max-frags' variable was not used and the 'trackers' variable was not documented. This patch fixes the two issues. --- src/defrag.c | 6 +++++- suricata.yaml.in | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/defrag.c b/src/defrag.c index 99a320a848..f793b7d056 100644 --- a/src/defrag.c +++ b/src/defrag.c @@ -55,6 +55,7 @@ #endif #define DEFAULT_DEFRAG_HASH_SIZE 0xffff +#define DEFAULT_DEFRAG_POOL_SIZE 0xffff /** * Default timeout (in seconds) before a defragmentation tracker will @@ -449,7 +450,10 @@ DefragContextNew(void) } /* Initialize the pool of frags. */ - int frag_pool_size = 0xffff; + int frag_pool_size; + if (!ConfGetInt("defrag.max-frags", &frag_pool_size)) { + frag_pool_size = DEFAULT_DEFRAG_POOL_SIZE; + } int frag_pool_prealloc = frag_pool_size / 4; dc->frag_pool = PoolInit(frag_pool_size, frag_pool_prealloc, DefragFragNew, dc, DefragFragFree); diff --git a/suricata.yaml.in b/suricata.yaml.in index a2ceaba5c7..4f0d176941 100644 --- a/suricata.yaml.in +++ b/suricata.yaml.in @@ -430,7 +430,8 @@ pattern-matcher: # Defrag settings: defrag: - max-frags: 65535 + trackers: 65535 # number of defragmented flows to follow + max-frags: 65535 # number of fragments per-flow prealloc: yes timeout: 60