All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft v2] ct: fix "ct l3proto/protocol" syntax broken
@ 2016-10-30 12:36 Liping Zhang
  2016-10-30 18:08 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Liping Zhang @ 2016-10-30 12:36 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, fw, Liping Zhang

From: Liping Zhang <zlpnobody@gmail.com>

"l3proto" and "protocol" are still keywords in our grammer, they are not
STRING, so if the user input the following rule, nft will complain that
the syntax is error:
  # nft add t c ct l3proto ipv4
  <cmdline>:1:12-18: Error: syntax error, unexpected l3proto, expecting
  string or mark or packets or bytes
  add t c ct l3proto ipv4
             ^^^^^^^

Fixes: c992153402c7 ("ct: allow resolving ct keys at run time")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
---
V2: Sorry for this, the first version has some code style issues,
    tab and space are mixed.

 src/parser_bison.y | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 106df27..fa5de0c 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -2629,7 +2629,9 @@ ct_expr			: 	CT	ct_key
 			}
 			;
 
-ct_key			:	MARK		{ $$ = NFT_CT_MARK; }
+ct_key			:	L3PROTOCOL	{ $$ = NFT_CT_L3PROTOCOL; }
+			|	PROTOCOL	{ $$ = NFT_CT_PROTOCOL; }
+			|	MARK		{ $$ = NFT_CT_MARK; }
 			|	ct_key_counters
 			;
 ct_key_dir		:	SADDR		{ $$ = NFT_CT_SRC; }
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nft v2] ct: fix "ct l3proto/protocol" syntax broken
  2016-10-30 12:36 [PATCH nft v2] ct: fix "ct l3proto/protocol" syntax broken Liping Zhang
@ 2016-10-30 18:08 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2016-10-30 18:08 UTC (permalink / raw)
  To: Liping Zhang; +Cc: pablo, netfilter-devel, fw, Liping Zhang

Liping Zhang <zlpnobody@163.com> wrote:
> From: Liping Zhang <zlpnobody@gmail.com>
> 
> "l3proto" and "protocol" are still keywords in our grammer, they are not
> STRING, so if the user input the following rule, nft will complain that
> the syntax is error:
>   # nft add t c ct l3proto ipv4
>   <cmdline>:1:12-18: Error: syntax error, unexpected l3proto, expecting
>   string or mark or packets or bytes
>   add t c ct l3proto ipv4
              ^^^^^^^
Applied, thanks for fixing this up.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-30 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-30 12:36 [PATCH nft v2] ct: fix "ct l3proto/protocol" syntax broken Liping Zhang
2016-10-30 18:08 ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.