summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/rule.c b/src/rule.c
index 0a1d6317..7a7ac73b 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -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 ||