From c62df142dcbc3f4123bf3c677abfbe53ce5d9167 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 25 Sep 2015 12:43:35 +0200 Subject: rule: display table when listing sets After this patch: # nft list sets ip table ip test { set pepe { type ipv4_addr } } Before: # nft list sets ip set pepe { type ipv4_addr } Signed-off-by: Pablo Neira Ayuso Acked-by: Arturo Borrero Gonzalez --- src/rule.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 1bf0e03e..fa3d4c11 100644 --- a/src/rule.c +++ b/src/rule.c @@ -984,8 +984,18 @@ static int do_list_sets(struct netlink_ctx *ctx, struct cmd *cmd) struct set *set; list_for_each_entry(table, &table_list, list) { + if (cmd->handle.family != NFPROTO_UNSPEC && + cmd->handle.family != table->handle.family) + continue; + + printf("table %s %s {\n", + family2str(table->handle.family), + table->handle.table); + list_for_each_entry(set, &table->sets, list) set_print(set); + + printf("}\n"); } return 0; } -- cgit v1.2.3