[PATCH nft 2/2] parser: restore named vmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For example:

nft add map filter my_vmap { type ipv4_addr : verdict\; }
nft add element filter my_vmap { 1.0.0.0 : drop}
nft add rule filter input ip saddr vmap @my_vmap

Reported-by: Bjørnar Ness <bjornar.ness@xxxxxxxxx>
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/parser_bison.y |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 6eb0475..ad2951a 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1211,6 +1211,13 @@ verdict_map_expr	:	'{'	verdict_map_list_expr	'}'
 				$2->location = @$;
 				$$ = $2;
 			}
+			|	AT	identifier
+			{
+				$$ = symbol_expr_alloc(&@$, SYMBOL_SET,
+						       current_scope(state),
+						       $2);
+				xfree($2);
+			}
 			;
 
 verdict_map_list_expr	:	verdict_map_list_member_expr
@@ -1691,6 +1698,10 @@ set_list_member_expr	:	opt_newline	expr	opt_newline
 			{
 				$$ = mapping_expr_alloc(&@$, $2, $4);
 			}
+			|	opt_newline	map_lhs_expr	COLON	verdict_expr	opt_newline
+			{
+				$$ = mapping_expr_alloc(&@$, $2, $4);
+			}
 			;
 
 initializer_expr	:	expr
-- 
1.7.10.4

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




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux