Skip to content

Commit a8c198d

Browse files
Aleksei OladkoPaolo Abeni
authored andcommitted
selftests: forwarding: fix pedit tests failure with br_netfilter enabled
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 ensuring net.bridge.bridge-nf-call-iptables is set to 0 during the test execution. This prevents the bridge from passing L2 traffic to netfilter, bypassing the checksum validation that causes the test failure. Fixes: 92ad382 ("selftests: forwarding: Add a test for pedit munge SIP and DIP") Fixes: 226657b ("selftests: forwarding: Add a forwarding test for pedit munge dsfield") Signed-off-by: Aleksei Oladko <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent ce9f6ae commit a8c198d

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

tools/testing/selftests/net/forwarding/pedit_dsfield.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,20 @@ setup_prepare()
9898
h1_create
9999
h2_create
100100
switch_create
101+
102+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
103+
sysctl_set net.bridge.bridge-nf-call-iptables 0
104+
fi
101105
}
102106

103107
cleanup()
104108
{
105109
pre_cleanup
106110

111+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
112+
sysctl_restore net.bridge.bridge-nf-call-iptables
113+
fi
114+
107115
switch_destroy
108116
h2_destroy
109117
h1_destroy

tools/testing/selftests/net/forwarding/pedit_ip.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,20 @@ setup_prepare()
9191
h1_create
9292
h2_create
9393
switch_create
94+
95+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
96+
sysctl_set net.bridge.bridge-nf-call-iptables 0
97+
fi
9498
}
9599

96100
cleanup()
97101
{
98102
pre_cleanup
99103

104+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
105+
sysctl_restore net.bridge.bridge-nf-call-iptables
106+
fi
107+
100108
switch_destroy
101109
h2_destroy
102110
h1_destroy

0 commit comments

Comments
 (0)