]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser: add 'delete map' syntax
authorPhil Oester <kernel@linuxace.com>
Sat, 30 Nov 2013 20:41:21 +0000 (12:41 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 30 Nov 2013 20:50:03 +0000 (21:50 +0100)
Creating a map is done via "add map".  However, to delete a map requires using
"delete set", which is confusing.  Add the appropriate synonym to parser.
The downside to this is that one can now delete a set with "delete map", but
this seems a minor issue.  It could of course be fixed by adding a new
CMD_OBJ_MAP.

This closes netfilter bugzilla #879.

Reported-by: Bjørnar Ness <bjornar.ness@gmail.com>
Signed-off-by: Phil Oester <kernel@linuxace.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser.y

index c6f8c9d448f71b44054f01039b5a553368488afa..26e71e37669b6885c5e1ae8d61f6476ff617c261 100644 (file)
@@ -605,6 +605,10 @@ delete_cmd         :       TABLE           table_spec
                        {
                                $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, &@$, NULL);
                        }
+                       |       MAP             set_spec
+                       {
+                               $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, &@$, NULL);
+                       }
                        |       ELEMENT         set_spec        set_expr
                        {
                                $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SETELEM, &$2, &@$, $3);