Skip to content

Commit debb5c5

Browse files
author
Florian Westphal
committed
tests: meta: icmp, icmpv6: don't kill required dependencies
when explicitly filtering icmp-in-ipv6 and icmp6-in-ip don't remove the required l3 protocol dependency, else "nft list ruleset" can't be read via nft -f anymore. Signed-off-by: Florian Westphal <[email protected]>
1 parent 483e5ea commit debb5c5

File tree

5 files changed

+48
-8
lines changed

5 files changed

+48
-8
lines changed

tests/py/any/meta.t

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ meta l4proto { 33, 55, 67, 88};ok;meta l4proto { 33, 55, 67, 88}
3333
meta l4proto != { 33, 55, 67, 88};ok
3434
meta l4proto { 33-55};ok
3535
meta l4proto != { 33-55};ok
36-
meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-advert
3736

3837
meta priority root;ok
3938
meta priority none;ok

tests/py/any/meta.t.payload

-7
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,6 @@ ip test-ip4 input
161161
[ byteorder reg 1 = hton(reg 1, 2, 1) ]
162162
[ lookup reg 1 set __set%d 0x1 ]
163163

164-
# meta l4proto ipv6-icmp icmpv6 type nd-router-advert
165-
ip test-ip4 input
166-
[ meta load l4proto => reg 1 ]
167-
[ cmp eq reg 1 0x0000003a ]
168-
[ payload load 1b @ transport header + 0 => reg 1 ]
169-
[ cmp eq reg 1 0x00000086 ]
170-
171164
# meta mark 0x4
172165
ip test-ip4 input
173166
[ meta load mark => reg 1 ]

tests/py/ip/meta.t

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:input;type filter hook input priority 0
2+
3+
*ip;test-ip4;input
4+
5+
icmp type echo-request;ok
6+
meta l4proto icmp icmp type echo-request;ok;icmp type echo-request
7+
meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;meta l4proto 58 icmpv6 type nd-router-advert
8+
meta l4proto 58 icmpv6 type nd-router-advert;ok
9+
icmpv6 type nd-router-advert;fail

tests/py/ip/meta.t.payload

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# icmp type echo-request
2+
ip test-ip4 input
3+
[ meta load l4proto => reg 1 ]
4+
[ cmp eq reg 1 0x00000001 ]
5+
[ payload load 1b @ transport header + 0 => reg 1 ]
6+
[ cmp eq reg 1 0x00000008 ]
7+
8+
# meta l4proto icmp icmp type echo-request
9+
ip test-ip4 input
10+
[ meta load l4proto => reg 1 ]
11+
[ cmp eq reg 1 0x00000001 ]
12+
[ payload load 1b @ transport header + 0 => reg 1 ]
13+
[ cmp eq reg 1 0x00000008 ]
14+
15+
# meta l4proto ipv6-icmp icmpv6 type nd-router-advert
16+
ip test-ip4 input
17+
[ meta load l4proto => reg 1 ]
18+
[ cmp eq reg 1 0x0000003a ]
19+
[ payload load 1b @ transport header + 0 => reg 1 ]
20+
[ cmp eq reg 1 0x00000086 ]
21+
22+
# meta l4proto 58 icmpv6 type nd-router-advert
23+
ip test-ip4 input
24+
[ meta load l4proto => reg 1 ]
25+
[ cmp eq reg 1 0x0000003a ]
26+
[ payload load 1b @ transport header + 0 => reg 1 ]
27+
[ cmp eq reg 1 0x00000086 ]
28+

tests/py/ip6/meta.t

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:input;type filter hook input priority 0
2+
3+
*ip6;test-ip6;input
4+
5+
icmpv6 type nd-router-advert;ok
6+
meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-advert
7+
8+
meta l4proto icmp icmp type echo-request;ok;meta l4proto 1 icmp type echo-request
9+
meta l4proto 1 icmp type echo-request;ok
10+
11+
icmp type echo-request;fail

0 commit comments

Comments
 (0)