Message ID | 1444337370-8269-2-git-send-email-pablo@netfilter.org |
---|---|
State | Accepted |
Delegated to: | Pablo Neira |
Headers | show |
diff --git a/src/rule.c b/src/rule.c index 92b83f0..71b26e3 100644 --- a/src/rule.c +++ b/src/rule.c @@ -983,8 +983,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; }
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 <pablo@netfilter.org> --- src/rule.c | 10 ++++++++++ 1 file changed, 10 insertions(+)