Skip to content

Commit cc1c78b

Browse files
committed
test(rpfilter): workaround nftables CLI output change
Since nftables commit f4b646032acf ("fib: allow to check if route exists in maps") the fib match now displays using the "check" keyword. Normalize older nftables versions to the new output and update all the tests.
1 parent d99076a commit cc1c78b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/tests/features/rpfilter.at

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ NFT_LIST_RULES([inet], [filter_PREROUTING], 0, [dnl
99
table inet firewalld {
1010
chain filter_PREROUTING {
1111
icmpv6 type { nd-router-advert, nd-neighbor-solicit } accept
12-
meta nfproto ipv6 fib saddr . mark . iif oif missing drop
12+
meta nfproto ipv6 fib saddr . mark . iif check missing drop
1313
}
1414
}
1515
])
@@ -35,7 +35,7 @@ NFT_LIST_RULES([inet], [filter_PREROUTING], 0, [dnl
3535
table inet firewalld {
3636
chain filter_PREROUTING {
3737
icmpv6 type { nd-router-advert, nd-neighbor-solicit } accept
38-
meta nfproto ipv6 fib saddr . mark oif missing drop
38+
meta nfproto ipv6 fib saddr . mark check missing drop
3939
}
4040
}
4141
])
@@ -65,7 +65,7 @@ FWD_RELOAD()
6565
NFT_LIST_RULES([inet], [filter_FORWARD], 0, [dnl
6666
table inet firewalld {
6767
chain filter_FORWARD {
68-
meta nfproto ipv6 fib saddr . mark . iif oif missing drop
68+
meta nfproto ipv6 fib saddr . mark . iif check missing drop
6969
ct state established,related accept
7070
ct status dnat accept
7171
iifname "lo" accept
@@ -101,7 +101,7 @@ FWD_RELOAD()
101101
NFT_LIST_RULES([inet], [filter_FORWARD], 0, [dnl
102102
table inet firewalld {
103103
chain filter_FORWARD {
104-
meta nfproto ipv6 fib saddr . mark oif missing drop
104+
meta nfproto ipv6 fib saddr . mark check missing drop
105105
ct state established,related accept
106106
ct status dnat accept
107107
iifname "lo" accept

src/tests/functions.at

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ m4_define([NFT_LIST_RULES_NORMALIZE], [dnl
478478
dnl newer nft replace ICMP reject aliases with code values
479479
dnl nftables commit 5fecd2a6ef61 ("src: disentangle ICMP code types")
480480
-e ['s/\(icmp\|icmpv6\|icmpx\) code no-route/\1 code 0/g'] dnl
481+
dnl nftables commit f4b646032acf ("fib: allow to check if route exists in maps")
482+
dnl changed the fib output. Now uses "check" keyword.
483+
-e ['s/oif missing/check missing/g'] dnl
481484
])
482485

483486
m4_define([NFT_LIST_RULES_ALWAYS], [

src/tests/regression/gh258.at

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ IF_HOST_SUPPORTS_NFT_FIB([
114114
table inet firewalld {
115115
chain filter_PREROUTING {
116116
icmpv6 type { nd-router-advert, nd-neighbor-solicit } accept
117-
meta nfproto ipv6 fib saddr . mark . iif oif missing drop
117+
meta nfproto ipv6 fib saddr . mark . iif check missing drop
118118
}
119119
}
120120
])

0 commit comments

Comments
 (0)