diff options
author | Harsha Sharma <harshasharmaiitr@gmail.com> | 2018-07-08 12:41:03 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-07-10 12:37:00 +0200 |
commit | 88456a7ef011728a98c950447630f0a128dcad13 (patch) | |
tree | 173871e07788a14245e5d10e8760847c1b812301 /src/rule.c | |
parent | 0e9cb91294f8015d91413a0dd00bd5c2b78842b2 (diff) |
rule: list only the table containing object
For e.g.
% nft list ct helper ip raw cthelp1
table ip filter {
}
table ip raw {
ct helper cthelp1 {
type "ftp" protocol tcp
l3proto ip
}
}
With this patch, print only table raw.
Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1593,15 +1593,13 @@ static int do_list_obj(struct netlink_ctx *ctx, struct cmd *cmd, uint32_t type) cmd->handle.family != table->handle.family) continue; - nft_print(ctx->octx, "table %s %s {\n", - family2str(table->handle.family), - table->handle.table.name); - if (cmd->handle.table.name != NULL && - strcmp(cmd->handle.table.name, table->handle.table.name)) { - nft_print(ctx->octx, "}\n"); + !strcmp(cmd->handle.table.name, table->handle.table.name)) { + nft_print(ctx->octx, "table %s %s {\n", + family2str(table->handle.family), + cmd->handle.table.name); + } else continue; - } list_for_each_entry(obj, &table->objs, list) { if (obj->type != type || |