From 0d4b200672c8a46cf06210afc8c72cb12af632b8 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 9 Mar 2016 12:23:00 +0100 Subject: parser_bison: allow 'snat' and 'dnat' keywords from the right-hand side Parse 'snat' and 'dnat' reserved keywords from the right-hand side as symbols. Thus, we can use them as values from ct status. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=950 Reported-by: Ana Rey Reported-by: Karol Babioch Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 3f226399..90978ab6 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2196,6 +2196,18 @@ primary_rhs_expr : symbol_expr { $$ = $1; } BYTEORDER_HOST_ENDIAN, sizeof(data) * BITS_PER_BYTE, &data); } + | SNAT + { + $$ = symbol_expr_alloc(&@$, SYMBOL_VALUE, + current_scope(state), + "snat"); + } + | DNAT + { + $$ = symbol_expr_alloc(&@$, SYMBOL_VALUE, + current_scope(state), + "dnat"); + } ; relational_op : EQ { $$ = OP_EQ; } -- cgit v1.2.3