selftests: net: disable rp_filter after namespace initialization
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 8 May 2025 08:19:05 +0000 (08:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 May 2025 01:10:55 +0000 (18:10 -0700)
commitce17831f8e970cadaba88605b4b1b1a8b2b50808
treea0caada85dda1717b77c47f15f20afa9fb251723
parentc14e1ecefd9e706262ac713fd27530e3344ef85c
selftests: net: disable rp_filter after namespace initialization

Some distributions enable rp_filter globally by default. To ensure consistent
behavior across environments, we explicitly disable it in several test cases.

This patch moves the rp_filter disabling logic to immediately after the
network namespace is initialized. With this change, individual test cases
with creating namespace via setup_ns no longer need to disable rp_filter
again.

This helps avoid redundancy and ensures test consistency.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250508081910.84216-2-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib.sh