]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: fix nft list chain
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 18 Apr 2013 14:28:41 +0000 (16:28 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 18 Apr 2013 14:38:09 +0000 (16:38 +0200)
Use netlink_list_chains instead of netlink_list_chain (note the final `s')

After "nft list table filter" shows:

table filter {
        chain input {
        }
}

"nft list chain filter input" shows:

table filter {
}

src/rule.c

index 43b683caf4c1ba19dbf86c3234058a1abb38f416..67ff58425ede73c0412b70bf2b7bfe7e5bf88bee 100644 (file)
@@ -501,7 +501,10 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
        case CMD_OBJ_CHAIN:
                if (do_list_sets(ctx, table) < 0)
                        return -1;
-               if (netlink_list_chain(ctx, &cmd->handle) < 0)
+               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;
        case CMD_OBJ_SETS: