diff mbox series

[net-next] selftests: disable rp_filter when testing bareudp

Message ID 28140b7d20161e4f766b558018fe2718f9bc1117.1604767577.git.gnault@redhat.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] selftests: disable rp_filter when testing bareudp | expand

Checks

Context Check Description
jkicinski/cover_letter success Link
jkicinski/fixes_present success Link
jkicinski/patch_count success Link
jkicinski/tree_selection success Clearly marked for net-next
jkicinski/subject_prefix success Link
jkicinski/source_inline success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/module_param success Was 0 now: 0
jkicinski/build_32bit success Errors and warnings before: 0 this patch: 0
jkicinski/kdoc success Errors and warnings before: 0 this patch: 0
jkicinski/verify_fixes success Link
jkicinski/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
jkicinski/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
jkicinski/header_inline success Link
jkicinski/stable success Stable not CCed

Commit Message

Guillaume Nault Nov. 7, 2020, 4:47 p.m. UTC
Some systems have rp_filter=1 as default configuration. This breaks
bareudp.sh as the intermediate namespaces handle part of the routing
with regular IPv4 routes but the reverse path is done with tc
(flower/tunnel_key/mirred).

Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
 tools/testing/selftests/net/bareudp.sh | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jakub Kicinski Nov. 10, 2020, 11:15 p.m. UTC | #1
On Sat, 7 Nov 2020 17:47:17 +0100 Guillaume Nault wrote:
> Some systems have rp_filter=1 as default configuration. This breaks
> bareudp.sh as the intermediate namespaces handle part of the routing
> with regular IPv4 routes but the reverse path is done with tc
> (flower/tunnel_key/mirred).
> 
> Signed-off-by: Guillaume Nault <gnault@redhat.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/bareudp.sh b/tools/testing/selftests/net/bareudp.sh
index c6fe22de7d0e..c2b9e990e544 100755
--- a/tools/testing/selftests/net/bareudp.sh
+++ b/tools/testing/selftests/net/bareudp.sh
@@ -234,6 +234,12 @@  setup_overlay_ipv4()
 	ip netns exec "${NS2}" sysctl -qw net.ipv4.ip_forward=1
 	ip -netns "${NS1}" route add 192.0.2.100/32 via 192.0.2.10
 	ip -netns "${NS2}" route add 192.0.2.103/32 via 192.0.2.33
+
+	# The intermediate namespaces don't have routes for the reverse path,
+	# as it will be handled by tc. So we need to ensure that rp_filter is
+	# not going to block the traffic.
+	ip netns exec "${NS1}" sysctl -qw net.ipv4.conf.default.rp_filter=0
+	ip netns exec "${NS2}" sysctl -qw net.ipv4.conf.default.rp_filter=0
 }
 
 setup_overlay_ipv6()