diff mbox series

[nft] rule: limit: don't print default burst value

Message ID 20180704131012.30087-1-fw@strlen.de
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft] rule: limit: don't print default burst value | expand

Commit Message

Florian Westphal July 4, 2018, 1:10 p.m. UTC
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>
---
 src/rule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Neira Ayuso July 4, 2018, 4:57 p.m. UTC | #1
On Wed, Jul 04, 2018 at 03:10:12PM +0200, Florian Westphal wrote:
> 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>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/src/rule.c b/src/rule.c
index 56b956a4f8fe..188fc062129c 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1479,7 +1479,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;