]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: Print handle attribute in chains
authorHarsha Sharma <harshasharmaiitr@gmail.com>
Tue, 9 Jan 2018 18:59:01 +0000 (00:29 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 5 Mar 2018 15:39:35 +0000 (16:39 +0100)
Print handle attribute in chains when listing via '-a' option.

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index 52b6adacec8f9251f0baf72da082b122e4c5622d..29343f75685a5898a43e1445f14b927436a3be0e 100644 (file)
@@ -746,7 +746,10 @@ static void chain_print(const struct chain *chain, struct output_ctx *octx)
                rule_print(rule, octx);
                nft_print(octx, "\n");
        }
-       nft_print(octx, "\t}\n");
+       nft_print(octx, "\t}");
+       if (octx->handle > 0)
+               nft_print(octx, " # handle %" PRIu64, chain->handle.handle.id);
+       nft_print(octx, "\n");
 }
 
 void chain_print_plain(const struct chain *chain, struct output_ctx *octx)