]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
ct: fix "ct l3proto/protocol" syntax broken
authorLiping Zhang <zlpnobody@gmail.com>
Sun, 30 Oct 2016 12:36:14 +0000 (20:36 +0800)
committerFlorian Westphal <fw@strlen.de>
Sun, 30 Oct 2016 18:05:05 +0000 (19:05 +0100)
"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>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/parser_bison.y

index 106df2710104d3c1bf7ec1df65a6bef527527d9a..fa5de0c2ea797a54b5b11252a159cd371c7824ce 100644 (file)
@@ -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; }