* [PATCH nft 1/2] rule: filter out tables depending on family
@ 2015-09-22 22:20 Pablo Neira Ayuso
2015-09-22 22:20 ` [PATCH nft 2/2] parser: show all tables via list tables with no family Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-09-22 22:20 UTC (permalink / raw)
To: netfilter-devel; +Cc: kaber, nvinson234
# 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 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/rule.c b/src/rule.c
index 43cc4a8..92b83f0 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -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;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH nft 2/2] parser: show all tables via list tables with no family
2015-09-22 22:20 [PATCH nft 1/2] rule: filter out tables depending on family Pablo Neira Ayuso
@ 2015-09-22 22:20 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-09-22 22:20 UTC (permalink / raw)
To: netfilter-devel; +Cc: kaber, nvinson234
Default to the same behaviour that we get through `list ruleset', ie.
# nft list tables
table ip filter
table ip6 filter
# 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/parser_bison.y | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 385e214..36910a7 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -767,7 +767,7 @@ list_cmd : TABLE table_spec
{
$$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, &@$, NULL);
}
- | TABLES tables_spec
+ | TABLES ruleset_spec
{
$$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, &@$, NULL);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-22 22:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 22:20 [PATCH nft 1/2] rule: filter out tables depending on family Pablo Neira Ayuso
2015-09-22 22:20 ` [PATCH nft 2/2] parser: show all tables via list tables with no family Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).