From 757b3ab08b8b22f230fb8e481bec78ecbfbb335a Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 7 Jan 2016 13:23:33 +0100 Subject: nft: swap key and direction in ct_dir syntax old: ct saddr original 1.2.3.4 new: ct original saddr 1.2.3.4 The advantage is that this allows to add ct keys where direction is optional without creating ambiguities in the parser. So we can have ct packets gt 42 ct original packets gt 42 Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- src/parser_bison.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index fcf84b9a..ca9b757a 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2252,18 +2252,18 @@ ct_expr : CT ct_key { $$ = ct_expr_alloc(&@$, $2, -1); } - | CT ct_key_dir STRING + | CT STRING ct_key_dir { struct error_record *erec; int8_t direction; - erec = ct_dir_parse(&@$, $3, &direction); + erec = ct_dir_parse(&@$, $2, &direction); if (erec != NULL) { erec_queue(erec, state->msgs); YYERROR; } - $$ = ct_expr_alloc(&@$, $2, direction); + $$ = ct_expr_alloc(&@$, $3, direction); } ; -- cgit v1.2.3