]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser: re-enable support for concatentation on map RHS
authorFlorian Westphal <fw@strlen.de>
Tue, 23 Feb 2021 11:12:40 +0000 (12:12 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 23 Feb 2021 11:12:49 +0000 (12:12 +0100)
"typeof .... : ip saddr . tcp dport" is legal.

This makes 'testcases/maps/nat_addr_port' pass again.

Fixes: 4ab1e5e6077918 ("src: allow use of 'verdict' in typeof definitions")
Signed-off-by: Florian Westphal <fw@strlen.de>
src/parser_bison.y

index 3c8013b2493e13d7e2f068a6c7b171d3c3d19e10..2d5d8e4836391069b423a3ec07b5ed2d9d128b35 100644 (file)
@@ -1760,6 +1760,15 @@ typeof_data_expr :       primary_expr
                                }
                                $$ = e;
                        }
+                       |       typeof_expr             DOT             primary_expr
+                       {
+                               struct location rhs[] = {
+                                       [1]     = @2,
+                                       [2]     = @3,
+                               };
+
+                               $$ = handle_concat_expr(&@$, $$, $1, $3, rhs);
+                       }
                        ;
 
 typeof_expr            :       primary_expr