From 4ab1e5e6077918b5b0b4553daa907a725d4cd0fe Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sat, 30 Jan 2021 19:58:42 +0100 Subject: src: allow use of 'verdict' in typeof definitions 'verdict' cannot be used as part of a map typeof-based key definition, its a datatype and not an expression, e.g.: typeof iifname . ip protocol . th dport : verdic ... will fail. Make the parser convert a 'verdict' symbol to a verdict expression and allow to store its presence as part of the typeof key definition. Reported-by: Frank Myhr Signed-off-by: Florian Westphal --- tests/shell/testcases/maps/dumps/typeof_maps_0.nft | 4 ++++ tests/shell/testcases/maps/typeof_maps_0 | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'tests/shell/testcases/maps') diff --git a/tests/shell/testcases/maps/dumps/typeof_maps_0.nft b/tests/shell/testcases/maps/dumps/typeof_maps_0.nft index faa73cd1..438b9829 100644 --- a/tests/shell/testcases/maps/dumps/typeof_maps_0.nft +++ b/tests/shell/testcases/maps/dumps/typeof_maps_0.nft @@ -15,6 +15,10 @@ table inet t { 2.3.4.5 . 6.7.8.9 : 0x00000002 } } + map m4 { + typeof iifname . ip protocol . th dport : verdict + } + chain c { ct mark set osf name map @m1 meta mark set vlan id map @m2 diff --git a/tests/shell/testcases/maps/typeof_maps_0 b/tests/shell/testcases/maps/typeof_maps_0 index e1c4bba9..f024ebe0 100755 --- a/tests/shell/testcases/maps/typeof_maps_0 +++ b/tests/shell/testcases/maps/typeof_maps_0 @@ -22,6 +22,10 @@ EXPECTED="table inet t { 2.3.4.5 . 6.7.8.9 : 0x00000002 } } + map m4 { + typeof iifname . ip protocol . th dport : verdict + } + chain c { ct mark set osf name map @m1 ether type vlan meta mark set vlan id map @m2 -- cgit v1.2.3