]> git.ipfire.org Git - thirdparty/suricata.git/commit
util/thash: fix memcap consolidate function 5891/head
authorEric Leblond <eric@regit.org>
Thu, 11 Feb 2021 10:01:18 +0000 (11:01 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 22 Feb 2021 10:16:40 +0000 (11:16 +0100)
commit6ef28d0a7097fdeb5b64275a8ca37657008d0d72
treeb4a247221979498ad14f0ab8ff53e20c48d0e3a2
parentb3b64803e5e0fbd7700b9ca3b0a39be0d91a3130
util/thash: fix memcap consolidate function

The function THashConsolidateMemcap is used to allow to load a
dataset even when the memcap is not set. But the implementation
was in fact resetting the memcap value to the max of memory
usaga after loading and default memcap. As a result, the
function was resetting memcap to the default memcap even if
a huge memcap was set in the dataset definition. In the case
of dataset where we add to the set it was leading to memcap
limit hitting despite the settings of memcap by the user.

This patch udpates the code to set the final memcap value to
the max of memory usage after loading and set memcap.
src/util-thash.c