From: Michael Tremer Date: Wed, 2 Mar 2022 10:58:51 +0000 (+0000) Subject: ipset: The minimum hashsize is 64 X-Git-Tag: 0.9.11~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1f8927a4dcb9b86a8e6c1298b7bad36ad6920af;p=location%2Flibloc.git ipset: The minimum hashsize is 64 Signed-off-by: Michael Tremer --- diff --git a/src/python/export.py b/src/python/export.py index 1c6743c..3ee2294 100644 --- a/src/python/export.py +++ b/src/python/export.py @@ -152,8 +152,8 @@ class IpsetOutputWriter(OutputWriter): # divided by the hashsize factor. exponent = math.log(self.networks / self.HASHSIZE_FACTOR, 2) - # Return the size of the hash - return 2 ** math.ceil(exponent) + # Return the size of the hash (the minimum is 64) + return max(2 ** math.ceil(exponent), 64) def _write_header(self): # This must have a fixed size, because we will write the header again in the end