The tests use the tc pedit action to modify the IPv4 source address
("pedit ex munge ip src set"), but the IP header checksum is not
recalculated after the modification. As a result, the modified packet
fails sanity checks in br_netfilter after bridging and is dropped,
which causes the test to fail.
Fix this by adding an explicit checksum recalculation using the
"csum ip" action, so the modified packet contains a valid IPv4
checksum.
Note on IPv6:
The tests in pedit_ip.sh also cover IPv6 (test_ip6_src, test_ip6_dst).
The csum ip action is harmless for IPv6 packets since IPv6 has no
header checksum — it will be a no-op.
Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
---
tools/testing/selftests/net/forwarding/pedit_dsfield.sh | 5 +++--
tools/testing/selftests/net/forwarding/pedit_ip.sh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
index af008fbf2725..310f96fb2274 100755
--- a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
+++ b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
@@ -156,7 +156,7 @@ do_test_pedit_dsfield()
local daddr=$1; shift
tc filter add $pedit_locus handle 101 pref 1 \
- flower action pedit ex munge $pedit_action
+ flower action pedit ex munge $pedit_action pipe action csum ip
tc filter add dev $h2 ingress handle 101 pref 1 prot $match_prot \
flower skip_hw $match_flower action pass
@@ -229,7 +229,8 @@ do_test_ip_dscp_ecn()
tc filter add $locus handle 101 pref 1 \
flower action pedit ex munge ip dsfield set 124 retain 0xfc \
- action pedit ex munge ip dsfield set 1 retain 0x03
+ action pedit ex munge ip dsfield set 1 retain 0x03 \
+ pipe action csum ip
tc filter add dev $h2 ingress handle 101 pref 1 prot ip \
flower skip_hw ip_tos 125 action pass
diff --git a/tools/testing/selftests/net/forwarding/pedit_ip.sh b/tools/testing/selftests/net/forwarding/pedit_ip.sh
index d14efb2d23b2..a53ee3b1ef67 100755
--- a/tools/testing/selftests/net/forwarding/pedit_ip.sh
+++ b/tools/testing/selftests/net/forwarding/pedit_ip.sh
@@ -122,7 +122,7 @@ do_test_pedit_ip()
local mz_flags=$1; shift
tc filter add $pedit_locus handle 101 pref 1 \
- flower action pedit ex munge $pedit_action
+ flower action pedit ex munge $pedit_action pipe action csum ip
tc filter add dev $h2 ingress handle 101 pref 1 prot $match_prot \
flower skip_hw $match_flower action pass
--
2.43.0
On Tue, 10 Feb 2026 18:51:29 +0000 Aleksei Oladko wrote:
> The tests use the tc pedit action to modify the IPv4 source address
> ("pedit ex munge ip src set"), but the IP header checksum is not
> recalculated after the modification. As a result, the modified packet
> fails sanity checks in br_netfilter after bridging and is dropped,
> which causes the test to fail.
>
> Fix this by adding an explicit checksum recalculation using the
> "csum ip" action, so the modified packet contains a valid IPv4
> checksum.
>
> Note on IPv6:
> The tests in pedit_ip.sh also cover IPv6 (test_ip6_src, test_ip6_dst).
> The csum ip action is harmless for IPv6 packets since IPv6 has no
> header checksum — it will be a no-op.
I think this makes the test fail for us:
make: Entering directory '/srv/vmksft/testing/wt-3/tools/testing/selftests'
make[1]: Nothing to be done for 'all'.
TAP version 13
1..1
# timeout set to 10800
# selftests: net/forwarding: pedit_ip.sh
# 6.13 [+6.13] TEST: ping [ OK ]
# 7.09 [+0.97] TEST: ping6 [ OK ]
# 7.12 [+0.02] Error: Failed to load TC action module.
# 7.12 [+0.00] We have an error talking to the kernel
# 8.36 [+1.24] TEST: dev veth1 ingress pedit ip src set 198.51.100.1 [FAIL]
# 8.36 [+0.01] Expected to get 10 packets, but got 0.
# 8.37 [+0.01] Error: Cannot find specified filter chain.
# 8.38 [+0.00] We have an error talking to the kernel
# 8.39 [+0.01] Error: Failed to load TC action module.
# 8.39 [+0.00] We have an error talking to the kernel
# 9.63 [+1.24] TEST: dev veth2 egress pedit ip src set 198.51.100.1 [FAIL]
# 9.63 [+0.01] Expected to get 10 packets, but got 0.
# 9.64 [+0.00] Error: Cannot find specified filter chain.
# 9.64 [+0.00] We have an error talking to the kernel
# 9.65 [+0.01] Error: Failed to load TC action module.
# 9.65 [+0.00] We have an error talking to the kernel
# 10.89 [+1.24] TEST: dev veth1 ingress pedit ip dst set 198.51.100.1 [FAIL]
# 10.89 [+0.00] Expected to get 10 packets, but got 0.
# 10.90 [+0.01] Error: Cannot find specified filter chain.
# 10.91 [+0.00] We have an error talking to the kernel
# 10.91 [+0.01] Error: Failed to load TC action module.
# 10.91 [+0.00] We have an error talking to the kernel
# 12.14 [+1.23] TEST: dev veth2 egress pedit ip dst set 198.51.100.1 [FAIL]
# 12.15 [+0.01] Expected to get 10 packets, but got 0.
# 12.15 [+0.00] Error: Cannot find specified filter chain.
# 12.16 [+0.00] We have an error talking to the kernel
# 12.17 [+0.01] Error: Failed to load TC action module.
# 12.17 [+0.00] We have an error talking to the kernel
# 13.42 [+1.24] TEST: dev veth1 ingress pedit ip6 src set 2001:db8:2::1 [FAIL]
# 13.42 [+0.00] Expected to get 10 packets, but got 0.
# 13.43 [+0.01] Error: Cannot find specified filter chain.
# 13.43 [+0.00] We have an error talking to the kernel
# 13.45 [+0.01] Error: Failed to load TC action module.
# 13.45 [+0.00] We have an error talking to the kernel
# 14.69 [+1.24] TEST: dev veth2 egress pedit ip6 src set 2001:db8:2::1 [FAIL]
# 14.69 [+0.00] Expected to get 10 packets, but got 0.
# 14.70 [+0.00] Error: Cannot find specified filter chain.
# 14.70 [+0.00] We have an error talking to the kernel
# 14.71 [+0.01] Error: Failed to load TC action module.
# 14.72 [+0.00] We have an error talking to the kernel
# 15.96 [+1.24] TEST: dev veth1 ingress pedit ip6 dst set 2001:db8:2::1 [FAIL]
# 15.96 [+0.00] Expected to get 10 packets, but got 0.
# 15.97 [+0.01] Error: Cannot find specified filter chain.
# 15.97 [+0.00] We have an error talking to the kernel
# 15.99 [+0.01] Error: Failed to load TC action module.
# 15.99 [+0.00] We have an error talking to the kernel
# 17.23 [+1.24] TEST: dev veth2 egress pedit ip6 dst set 2001:db8:2::1 [FAIL]
# 17.23 [+0.01] Expected to get 10 packets, but got 0.
# 17.24 [+0.00] Error: Cannot find specified filter chain.
# 17.24 [+0.00] We have an error talking to the kernel
not ok 1 selftests: net/forwarding: pedit_ip.sh # exit=1
https://netdev-ctrl.bots.linux.dev/logs/vmksft/forwarding/results/512621/80-pedit-ip-sh/stdout
I could be wrong, kernel.org is having a DNS outage so our CI is a bit
unstable.
--
pw-bot: cr
© 2016 - 2026 Red Hat, Inc.