From: Patrick McHardy Date: Tue, 28 Jul 2009 12:17:41 +0000 (+0200) Subject: netlink: dump all chains when listing rules X-Git-Tag: v0.099~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeb84096c8cc413f81829f07ec285c3668d795ec;p=thirdparty%2Fnftables.git netlink: dump all chains when listing rules 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 --- diff --git a/src/rule.c b/src/rule.c index a5032cf7..3bf48aac 100644 --- a/src/rule.c +++ b/src/rule.c @@ -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;