Blame SOURCES/0061-extensions-hashlimit-Fix-tests-with-HZ-100.patch

0f637a
From ec4a91ac53e4dba210daa9bb3af9e09532c86b06 Mon Sep 17 00:00:00 2001
0f637a
From: Phil Sutter <phil@nwl.cc>
0f637a
Date: Mon, 9 Aug 2021 18:48:58 +0200
0f637a
Subject: [PATCH] extensions: hashlimit: Fix tests with HZ=100
0f637a
0f637a
With the kernel ticking at 100Hz, a limit of 1/day with burst 5 does not
0f637a
overflow in kernel, making the test unstable depending on kernel config.
0f637a
Change it to not overflow with 1000Hz either by increasing the burst
0f637a
value by a factor of 100.
0f637a
0f637a
Fixes: fcf9f6f25db11 ("extensions: libxt_hashlimit: add unit test")
0f637a
Signed-off-by: Phil Sutter <phil@nwl.cc>
0f637a
(cherry picked from commit bef9dc575625a98a5e6ed8ca37e49031cdba5937)
0f637a
---
0f637a
 extensions/libxt_hashlimit.t | 6 ++----
0f637a
 1 file changed, 2 insertions(+), 4 deletions(-)
0f637a
0f637a
diff --git a/extensions/libxt_hashlimit.t b/extensions/libxt_hashlimit.t
0f637a
index ccd0d1e6a2a1a..8369933786f68 100644
0f637a
--- a/extensions/libxt_hashlimit.t
0f637a
+++ b/extensions/libxt_hashlimit.t
0f637a
@@ -3,14 +3,12 @@
0f637a
 -m hashlimit --hashlimit-above 1000000/sec --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-above 1/min --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-above 1/hour --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
-# kernel says "xt_hashlimit: overflow, try lower: 864000000/5"
0f637a
--m hashlimit --hashlimit-above 1/day --hashlimit-burst 5 --hashlimit-name mini1;;FAIL
0f637a
+-m hashlimit --hashlimit-above 1/day --hashlimit-burst 500 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1/sec --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1000000/sec --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1/min --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1/hour --hashlimit-burst 5 --hashlimit-name mini1;=;OK
0f637a
-# kernel says "xt_hashlimit: overflow, try lower: 864000000/5"
0f637a
--m hashlimit --hashlimit-upto 1/day --hashlimit-burst 5 --hashlimit-name mini1;;FAIL
0f637a
+-m hashlimit --hashlimit-upto 1/day --hashlimit-burst 500 --hashlimit-name mini1;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1/sec --hashlimit-burst 1 --hashlimit-name mini1 --hashlimit-htable-expire 2000;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1/sec --hashlimit-burst 1 --hashlimit-mode srcip --hashlimit-name mini1 --hashlimit-htable-expire 2000;=;OK
0f637a
 -m hashlimit --hashlimit-upto 1/sec --hashlimit-burst 1 --hashlimit-mode dstip --hashlimit-name mini1 --hashlimit-htable-expire 2000;=;OK
0f637a
-- 
0f637a
2.33.0
0f637a