netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nftables: add 'delete map' syntax
@ 2013-11-30 20:41 Phil Oester
  2013-11-30 20:54 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Oester @ 2013-11-30 20:41 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

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>


[-- Attachment #2: patch-nft-map_delete --]
[-- Type: text/plain, Size: 433 bytes --]

diff --git a/src/parser.y b/src/parser.y
index a49e5c2..c736240 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -604,6 +604,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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-30 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-30 20:41 [PATCH] nftables: add 'delete map' syntax Phil Oester
2013-11-30 20:54 ` 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).