]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: filter out tables depending on family
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Sep 2015 22:06:42 +0000 (00:06 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 23 Sep 2015 10:17:07 +0000 (12:17 +0200)
 # nft list tables ip
 table ip filter

 # nft list tables ip6
 table ip6 filter

Closes: http://bugzilla.netfilter.org/show_bug.cgi?id=1033
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index 43cc4a8ad67fb0e18ecfcf37efd002b3b0cbe743..92b83f08d026956a0fa37dfc511596cfb3d5feca 100644 (file)
@@ -1013,10 +1013,15 @@ static int do_list_tables(struct netlink_ctx *ctx, struct cmd *cmd)
 {
        struct table *table;
 
-       list_for_each_entry(table, &table_list, list)
+       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);
+       }
 
        return 0;
 }