nftables/SOURCES/0051-rule-limit-don-t-print-default-burst-value.patch
2021-09-09 22:49:01 +00:00

37 lines
1.2 KiB
Diff

From a06d879ceba6b1ae7b541c223701435a4d1394e1 Mon Sep 17 00:00:00 2001
From: Florian Westphal <fw@strlen.de>
Date: Wed, 4 Jul 2018 15:10:12 +0200
Subject: [PATCH] rule: limit: don't print default burst value
limit http-traffic { rate 1/second } gets printed as
limit http-traffic { rate 1/second burst 5 packets }
caused tests/shell/run-tests.sh tests/shell/testcases/sets/0026named_limit_0
to return 'DUMP FAIL'.
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 1dc9be8445265498a2db534ae254260b6e7dd75b)
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
src/rule.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rule.c b/src/rule.c
index 0b494e4326be6..850b00cfc9874 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1472,7 +1472,7 @@ static void obj_print_data(const struct obj *obj,
nft_print(octx, "rate %s%" PRIu64 "/%s",
inv ? "over " : "", obj->limit.rate,
get_unit(obj->limit.unit));
- if (obj->limit.burst > 0)
+ if (obj->limit.burst > 0 && obj->limit.burst != 5)
nft_print(octx, " burst %u packets",
obj->limit.burst);
break;
--
2.21.0