From 9807bc39fd89431a6e26205eb1f86b949d505bde Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 5 Mar 2018 17:25:45 +0100 Subject: rule: print object handle with --echo --handle # nft --echo --handle add counter x y add counter ip x y { packets 0 bytes 0 } # handle 0 Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/rule.c b/src/rule.c index 99a99e8a..6af7d9a9 100644 --- a/src/rule.c +++ b/src/rule.c @@ -1503,6 +1503,9 @@ static void obj_print_declaration(const struct obj *obj, obj_print_data(obj, opts, octx); nft_print(octx, "%s%s}%s", opts->nl, opts->tab, opts->nl); + + if (octx->handle > 0) + nft_print(octx, "# handle %" PRIu64, obj->handle.handle.id); } void obj_print(const struct obj *obj, struct output_ctx *octx) -- cgit v1.2.3