From 028856b3dd8c935bc53ff08434dce4728627a318 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 3 Dec 2021 17:07:54 +0100 Subject: exthdr: support ip/tcp options and sctp chunks in typeof expressions This did not store the 'op' member and listing always treated this as ipv6 extension header. Add test cases for this. Signed-off-by: Florian Westphal --- tests/shell/testcases/sets/dumps/typeof_sets_0.nft | 27 ++++++++++++++++++++++ tests/shell/testcases/sets/typeof_sets_0 | 27 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) (limited to 'tests/shell/testcases/sets') diff --git a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft index 06d891e6..8f11b110 100644 --- a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft +++ b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft @@ -19,6 +19,21 @@ table inet t { elements = { 1, 1024 } } + set s5 { + typeof ip option ra value + elements = { 1, 1024 } + } + + set s6 { + typeof tcp option maxseg size + elements = { 1, 1024 } + } + + set s7 { + typeof sctp chunk init num-inbound-streams + elements = { 1, 4 } + } + chain c1 { osf name @s1 accept } @@ -26,4 +41,16 @@ table inet t { chain c2 { vlan id @s2 accept } + + chain c5 { + ip option ra value @s5 accept + } + + chain c6 { + tcp option maxseg size @s6 accept + } + + chain c7 { + sctp chunk init num-inbound-streams @s7 accept + } } diff --git a/tests/shell/testcases/sets/typeof_sets_0 b/tests/shell/testcases/sets/typeof_sets_0 index a6ff8ca7..1e99e298 100755 --- a/tests/shell/testcases/sets/typeof_sets_0 +++ b/tests/shell/testcases/sets/typeof_sets_0 @@ -25,6 +25,21 @@ EXPECTED="table inet t { elements = { 1, 1024 } } + set s5 { + typeof ip option ra value + elements = { 1, 1024 } + } + + set s6 { + typeof tcp option maxseg size + elements = { 1, 1024 } + } + + set s7 { + typeof sctp chunk init num-inbound-streams + elements = { 1, 4 } + } + chain c1 { osf name @s1 accept } @@ -32,6 +47,18 @@ EXPECTED="table inet t { chain c2 { ether type vlan vlan id @s2 accept } + + chain c5 { + ip option ra value @s5 accept + } + + chain c6 { + tcp option maxseg size @s6 accept + } + + chain c7 { + sctp chunk init num-inbound-streams @s7 accept + } }" set -e -- cgit v1.2.3