summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-12-02 11:23:29 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-03 14:21:53 +0100
commit0eaedf58acad4214dd827515c56b9da26ab9e9e3 (patch)
tree365c23cba9d9b1c60583092072333fba19918668
parent8ec2e8438a7c4c48c8005a5f352c8ea6cd40d2fe (diff)
parser_bison: allow RESET token from rhs
Stateful objects have introduced a RESET token in the parser. This breaks the use of RESET from the rhs, to fix this: 1) I added a new rule to catch this case, thus, dccp doesn't break. 2) Update reject_opts so reject with tcp reset still works. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/parser_bison.y16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index b571fbbe..5b829a24 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1897,15 +1897,9 @@ reject_opts : /* empty */
$4);
$<stmt>0->reject.expr->dtype = &icmpx_code_type;
}
- | WITH TCP STRING
+ | WITH TCP RESET
{
- if (strcmp($3, "reset") == 0) {
- $<stmt>0->reject.type = NFT_REJECT_TCP_RST;
- } else {
- erec_queue(error(&@2, "unsupported reject type", $3),
- state->msgs);
- YYERROR;
- }
+ $<stmt>0->reject.type = NFT_REJECT_TCP_RST;
}
;
@@ -2721,6 +2715,12 @@ primary_rhs_expr : symbol_expr { $$ = $1; }
current_scope(state),
"ecn");
}
+ | RESET
+ {
+ $$ = symbol_expr_alloc(&@$, SYMBOL_VALUE,
+ current_scope(state),
+ "reset");
+ }
;
relational_op : EQ { $$ = OP_EQ; }