Blame SOURCES/0062-extensions-hashlimit-Fix-tests-with-HZ-1000.patch

0f637a
From 41660ba1faea8b7ebd71e94c70ef175a75ab91cc Mon Sep 17 00:00:00 2001
0f637a
From: Phil Sutter <phil@nwl.cc>
0f637a
Date: Mon, 8 Nov 2021 17:03:21 +0100
0f637a
Subject: [PATCH] extensions: hashlimit: Fix tests with HZ=1000
0f637a
0f637a
In an attempt to fix for failing hashlimit tests with HZ=100, the
0f637a
expected failures were changed so they are expected to pass and the
0f637a
parameters changed to seemingly fix them. Yet while the new parameters
0f637a
worked on HZ=100 systems, with higher tick rates they didn't so the
0f637a
observed problem moved from the test failing on HZ=100 to failing on
0f637a
HZ=1000 instead.
0f637a
0f637a
Kernel's error message "try lower: 864000000/5" turned out to be a red
0f637a
herring: The burst value does not act as a dividor but a multiplier
0f637a
instead, so in order to lower the overflow-checked value, a lower burst
0f637a
value must be chosen. Inded, using a burst value of 1 makes the kernel
0f637a
accept the rule in both HZ=100 and HZ=1000 configurations.
0f637a
0f637a
Fixes: bef9dc575625a ("extensions: hashlimit: Fix tests with HZ=100")
0f637a
Signed-off-by: Phil Sutter <phil@nwl.cc>
0f637a
(cherry picked from commit 1eab8e83aec0e6965f11f8cad460add1caeae629)
0f637a
---
0f637a
 extensions/libxt_hashlimit.t | 4 ++--
0f637a
 1 file changed, 2 insertions(+), 2 deletions(-)
0f637a
0f637a
diff --git a/extensions/libxt_hashlimit.t b/extensions/libxt_hashlimit.t
0f637a
index 8369933786f68..206d92935f2e2 100644
0f637a
--- a/extensions/libxt_hashlimit.t
0f637a
+++ b/extensions/libxt_hashlimit.t
0f637a
@@ -3,12 +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
--m hashlimit --hashlimit-above 1/day --hashlimit-burst 500 --hashlimit-name mini1;=;OK
0f637a
+-m hashlimit --hashlimit-above 1/day --hashlimit-burst 1 --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
--m hashlimit --hashlimit-upto 1/day --hashlimit-burst 500 --hashlimit-name mini1;=;OK
0f637a
+-m hashlimit --hashlimit-upto 1/day --hashlimit-burst 1 --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