diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-03-05 18:22:00 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-03-05 18:22:00 +0100 |
commit | 4721c3b91f9a37da62b2db1524e254a0f36cebf9 (patch) | |
tree | 493eb0899235a01399682d980064625f07e4840d /src | |
parent | 2783e89a5cfe0d464f0cbb1f42e1e02e432fca92 (diff) |
rule: broken handle listing of table and named objects
Now listing looks good:
table ip test-ip {
counter https-traffic {
packets 0 bytes 0
} # handle 1
} # handle 847
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/rule.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -888,9 +888,12 @@ static void table_print(const struct table *table, struct output_ctx *octx) chain_print(chain, octx); delim = "\n"; } + nft_print(octx, "}"); + if (octx->handle > 0) nft_print(octx, " # handle %" PRIu64, table->handle.handle.id); - nft_print(octx, "}\n"); + + nft_print(octx, "\n"); } struct cmd *cmd_alloc(enum cmd_ops op, enum cmd_obj obj, @@ -1502,10 +1505,12 @@ 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); + nft_print(octx, "%s%s}", opts->nl, opts->tab); if (octx->handle > 0) - nft_print(octx, "# handle %" PRIu64, obj->handle.handle.id); + nft_print(octx, " # handle %" PRIu64, obj->handle.handle.id); + + nft_print(octx, "%s", opts->nl); } void obj_print(const struct obj *obj, struct output_ctx *octx) |