54 lines
1.9 KiB
Diff
54 lines
1.9 KiB
Diff
|
From 156f738087525eeb35e1225d8fb1e23da71dc58b Mon Sep 17 00:00:00 2001
|
||
|
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
||
|
Date: Thu, 14 Mar 2019 11:04:37 +0100
|
||
|
Subject: [PATCH] parser_bison: no need for statement separator for ct object
|
||
|
commands
|
||
|
|
||
|
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>
|
||
|
(cherry picked from commit d3cace26609253a8e3f20aeb8693f37d63897a7e)
|
||
|
|
||
|
Conflicts:
|
||
|
src/parser_bison.y
|
||
|
-> Some chunks dropped for missing commit c7c94802679cd
|
||
|
("src: add ct timeout support")
|
||
|
|
||
|
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||
|
---
|
||
|
src/parser_bison.y | 4 ++--
|
||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/src/parser_bison.y b/src/parser_bison.y
|
||
|
index f86a754deea8e..99d60822790dc 100644
|
||
|
--- a/src/parser_bison.y
|
||
|
+++ b/src/parser_bison.y
|
||
|
@@ -941,7 +941,7 @@ 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);
|
||
|
@@ -1023,7 +1023,7 @@ 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);
|
||
|
}
|
||
|
--
|
||
|
2.21.0
|
||
|
|