]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: do not print elements in dynamically populated sets with `-s'
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 07:52:14 +0000 (09:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 07:52:14 +0000 (09:52 +0200)
Ruleset listing with --stateless should not display the content of
sets that are dynamically populated from the packet path.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index df35f3e19b840fb56d57bf40624ba66657916b4d..aef43638f863cba764217e06dd0a8874ea272b9a 100644 (file)
@@ -427,6 +427,11 @@ static void do_set_print(const struct set *set, struct print_fmt_options *opts,
 {
        set_print_declaration(set, opts, octx);
 
+       if (set->flags & NFT_SET_EVAL && octx->stateless) {
+               nft_print(octx, "%s}%s", opts->tab, opts->nl);
+               return;
+       }
+
        if (set->init != NULL && set->init->size > 0) {
                nft_print(octx, "%s%selements = ", opts->tab, opts->tab);
                expr_print(set->init, octx);