]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_bison: no need for statement separator for ct object commands
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 Mar 2019 10:04:37 +0000 (11:04 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 Mar 2019 10:14:31 +0000 (11:14 +0100)
Otherwise, this forces user to place a double semi-colon to skip a
parser error in a multi-line commands:

 # nft add "ct helper ip filter test { type \"ftp\" protocol tcp; };add rule filter test ct helper set \"ftp\""
 Error: syntax error, unexpected add, expecting end of file or newline or semicolon
 add ct helper ip filter test { type "ftp" protocol tcp; };add rule filter test ct helper set "ftp"
                                                           ^^^

Reported-by: Laura Garcia <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_bison.y

index b20be3a896b0f09d3af0003dc9cd7b345de14da3..48e44e5adc406fed8f795f3052be124d3d781875 100644 (file)
@@ -986,12 +986,12 @@ add_cmd                   :       TABLE           table_spec
                        {
                                $$ = cmd_alloc(CMD_ADD, CMD_OBJ_QUOTA, &$2, &@$, $3);
                        }
-                       |       CT      HELPER  obj_spec        ct_obj_alloc    '{' ct_helper_block '}' stmt_separator
+                       |       CT      HELPER  obj_spec        ct_obj_alloc    '{' ct_helper_block '}'
                        {
 
                                $$ = cmd_alloc_obj_ct(CMD_ADD, NFT_OBJECT_CT_HELPER, &$3, &@$, $4);
                        }
-                       |       CT      TIMEOUT obj_spec        ct_obj_alloc    '{' ct_timeout_block '}' stmt_separator
+                       |       CT      TIMEOUT obj_spec        ct_obj_alloc    '{' ct_timeout_block '}'
                        {
                                $$ = cmd_alloc_obj_ct(CMD_ADD, NFT_OBJECT_CT_TIMEOUT, &$3, &@$, $4);
                        }
@@ -1076,11 +1076,11 @@ create_cmd              :       TABLE           table_spec
                        {
                                $$ = cmd_alloc(CMD_CREATE, CMD_OBJ_QUOTA, &$2, &@$, $3);
                        }
-                       |       CT      HELPER  obj_spec        ct_obj_alloc    '{' ct_helper_block '}' stmt_separator
+                       |       CT      HELPER  obj_spec        ct_obj_alloc    '{' ct_helper_block '}'
                        {
                                $$ = cmd_alloc_obj_ct(CMD_CREATE, NFT_OBJECT_CT_HELPER, &$3, &@$, $4);
                        }
-                       |       CT      TIMEOUT obj_spec        ct_obj_alloc    '{' ct_timeout_block '}' stmt_separator
+                       |       CT      TIMEOUT obj_spec        ct_obj_alloc    '{' ct_timeout_block '}'
                        {
                                $$ = cmd_alloc_obj_ct(CMD_CREATE, NFT_OBJECT_CT_TIMEOUT, &$3, &@$, $4);
                        }