]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: dump all chains when listing rules
authorPatrick McHardy <kaber@trash.net>
Tue, 28 Jul 2009 12:17:41 +0000 (14:17 +0200)
committerPatrick McHardy <kaber@trash.net>
Tue, 28 Jul 2009 12:17:41 +0000 (14:17 +0200)
Currently only the rules are dumped and chains are constructed based
on the rules identities. Dump all chains manually to make sure we also
display empty chains.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/rule.c

index a5032cf7b9f3d1cc9984398fe60fc37e94826ec4..3bf48aac72ff058935ffc8c6bab5514d75303a88 100644 (file)
@@ -465,6 +465,9 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
        case CMD_OBJ_TABLE:
                if (do_list_sets(ctx, table) < 0)
                        return -1;
+               if (netlink_list_chains(ctx, &cmd->handle) < 0)
+                       return -1;
+               list_splice_tail_init(&ctx->list, &table->chains);
                if (netlink_list_table(ctx, &cmd->handle) < 0)
                        return -1;
                break;