diff mbox

[nft] expression: fix output of verdict maps

Message ID 20140114090009.GB23920@macbook.localnet
State Accepted
Headers show

Commit Message

Patrick McHardy Jan. 14, 2014, 9 a.m. UTC
On Mon, Jan 13, 2014 at 12:42:03PM +0000, Patrick McHardy wrote:
> On Mon, Jan 13, 2014 at 01:39:16PM +0100, Pablo Neira Ayuso wrote:
> > % nft list table filter
> > table ip filter {
> > 	...
> > 	chain output {
> > 		...
> > 		ip saddr map { 1.1.1.1 => accept}
> > 	}
> > }
> > 
> > It displays 'map' instead of 'vmap'. Fix it by checking the mapping
> > type in map_expr_print().
> 
> The fix is fine of course, but even better would be to get rid of the
> vmap keyword IMO. IIRC it only exists because I couldn't manage to get
> a conflict free grammar together, but it would be worth another try.

Actually this works fine. Is there agreement on removing the VMAP keyword?
If so we should do it before the 0.099 release.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pablo Neira Ayuso Jan. 14, 2014, 11:29 a.m. UTC | #1
On Tue, Jan 14, 2014 at 09:00:09AM +0000, Patrick McHardy wrote:
> On Mon, Jan 13, 2014 at 12:42:03PM +0000, Patrick McHardy wrote:
> > On Mon, Jan 13, 2014 at 01:39:16PM +0100, Pablo Neira Ayuso wrote:
> > > % nft list table filter
> > > table ip filter {
> > > 	...
> > > 	chain output {
> > > 		...
> > > 		ip saddr map { 1.1.1.1 => accept}
> > > 	}
> > > }
> > > 
> > > It displays 'map' instead of 'vmap'. Fix it by checking the mapping
> > > type in map_expr_print().
> > 
> > The fix is fine of course, but even better would be to get rid of the
> > vmap keyword IMO. IIRC it only exists because I couldn't manage to get
> > a conflict free grammar together, but it would be worth another try.
> 
> Actually this works fine. Is there agreement on removing the VMAP keyword?
> If so we should do it before the 0.099 release.

Sure, go ahead. I like it :) and it's consistent with other data maps.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Patrick McHardy Jan. 14, 2014, 12:33 p.m. UTC | #2
On Tue, Jan 14, 2014 at 12:29:51PM +0100, Pablo Neira Ayuso wrote:
> On Tue, Jan 14, 2014 at 09:00:09AM +0000, Patrick McHardy wrote:
> > On Mon, Jan 13, 2014 at 12:42:03PM +0000, Patrick McHardy wrote:
> > > On Mon, Jan 13, 2014 at 01:39:16PM +0100, Pablo Neira Ayuso wrote:
> > > > % nft list table filter
> > > > table ip filter {
> > > > 	...
> > > > 	chain output {
> > > > 		...
> > > > 		ip saddr map { 1.1.1.1 => accept}
> > > > 	}
> > > > }
> > > > 
> > > > It displays 'map' instead of 'vmap'. Fix it by checking the mapping
> > > > type in map_expr_print().
> > > 
> > > The fix is fine of course, but even better would be to get rid of the
> > > vmap keyword IMO. IIRC it only exists because I couldn't manage to get
> > > a conflict free grammar together, but it would be worth another try.
> > 
> > Actually this works fine. Is there agreement on removing the VMAP keyword?
> > If so we should do it before the 0.099 release.
> 
> Sure, go ahead. I like it :) and it's consistent with other data maps.

Crap, I missed that it actually does introduce conflicts. Will try to solve
them or revert that patch.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/parser.y b/src/parser.y
index 7c18875..e5610e5 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -150,7 +150,6 @@  static void location_update(struct location *loc, struct location *rhs, int n)
 %token DASH			"-"
 %token AT			"@"
 %token ARROW			"=>"
-%token VMAP			"vmap"
 
 %token INCLUDE			"include"
 %token DEFINE			"define"
@@ -1273,7 +1272,7 @@  map_expr		:	concat_expr	MAP	expr
 			}
 			;
 
-verdict_map_expr	:	concat_expr	VMAP	expr
+verdict_map_expr	:	concat_expr	MAP	expr
 			{
 				$$ = map_expr_alloc(&@$, $1, $3);
 			}
diff --git a/src/scanner.l b/src/scanner.l
index 0b8abac..5a5ec72 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -210,7 +210,6 @@  addrstring	({macaddr}|{ip4addr}|{ip6addr})
 "$"			{ return '$'; }
 "="			{ return '='; }
 "=>"			{ return ARROW; }
-"vmap"			{ return VMAP; }
 
 "include"		{ return INCLUDE; }
 "define"		{ return DEFINE; }