Skip to contentSkip to conversation

src: restore nft --debug

PATCH New Pablo Neira Ayuso 1 participant 2 messages Nov 23, 2014 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/2 src: restore nft --debug

Add -DDEBUG to enable --debug option by default as it used to be before the autotools conversion.

Fixes 5fa8e49 ("build: autotools conversion")
---
 src/Makefile.am |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/Makefile.am +1 -1
index 0a67810..e8afd46 100644
@@ -3,7 +3,7 @@ sbin_PROGRAMS = nft
 CLEANFILES = scanner.c parser_bison.c
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\""
+AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" -DDEBUG
 		${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}
 
 AM_CFLAGS = -Wall								\
Signature · 1 line
1.7.10.4
author maintainer
#1 lore raw

PATCH 2/2 parser: restore named vmap

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

---
 src/parser_bison.y |   11 +++++++++++
 1 file changed, 11 insertions(+)
src/parser_bison.y +11 -0
index 6eb0475..ad2951a 100644
@@ -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
Signature · 6 lines
1.7.10.4

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