summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorElise Lennion <elise.lennion@gmail.com>2017-03-24 12:30:41 -0300
committerPablo Neira Ayuso <pablo@netfilter.org>2017-03-24 19:30:19 +0100
commite7d3210974e3c091ea11c1c9a94b07d3b5b6abd1 (patch)
tree6d50edcff5e1d348376a2ee2d73ec57e59d5e1a0 /src/parser_bison.y
parent535a7324626f45bded749dcee7e225f9e0fa28d0 (diff)
src: Make flush command selective of the set structure type
The internal set infrastructure is used for sets, maps and flow tables. The flush command requires the set type but currently it works for all of them. E.g. if there is a set named 's' in a table 't' the following command shouldn't be valid but still executes: $ nft flush flow table t s This patch makes the flush command selective so 'flush flow table' only works in flow tables and so on. Fixes: 6d37dae ("parser_bison: Allow flushing maps") Fixes: 2daa0ee ("parser_bison: Allow flushing flow tables") Signed-off-by: Elise Lennion <elise.lennion@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 841b2e17..9f993fd3 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1127,13 +1127,13 @@ flush_cmd : TABLE table_spec
{
$$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$2, &@$, NULL);
}
- | FLOW TABLE set_spec
+ | MAP set_spec
{
- $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$3, &@$, NULL);
+ $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_MAP, &$2, &@$, NULL);
}
- | MAP set_spec
+ | FLOW TABLE set_spec
{
- $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$2, &@$, NULL);
+ $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_FLOWTABLE, &$3, &@$, NULL);
}
| RULESET ruleset_spec
{