]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: limit: don't print default burst value
authorFlorian Westphal <fw@strlen.de>
Wed, 4 Jul 2018 13:10:12 +0000 (15:10 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 4 Jul 2018 20:01:14 +0000 (22:01 +0200)
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>
src/rule.c

index 56b956a4f8fecb82679c4511f95a690a99dbc009..188fc062129cc8ff0758f35d51b0eaa905700f3b 100644 (file)
@@ -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;