public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route
@ 2025-12-18 12:20 Ricardo B. Marlière
  2025-12-18 16:01 ` David Ahern
  2025-12-19 14:51 ` Fernando Fernandez Mancera
  0 siblings, 2 replies; 5+ messages in thread
From: Ricardo B. Marlière @ 2025-12-18 12:20 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, David Ahern
  Cc: netdev, linux-kselftest, linux-kernel, Ricardo B. Marlière

Currently, the test breaks if the SUT already has a default route
configured for IPv6. Fix by adding "metric 9999" to the `ip -6 ro add`
command, so that multiple default routes can coexist.

Fixes: 4ed591c8ab44 ("net/ipv6: Allow onlink routes to have a device mismatch if it is the default route")
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 tools/testing/selftests/net/fib-onlink-tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/fib-onlink-tests.sh b/tools/testing/selftests/net/fib-onlink-tests.sh
index ec2d6ceb1f08..acf6b0617373 100755
--- a/tools/testing/selftests/net/fib-onlink-tests.sh
+++ b/tools/testing/selftests/net/fib-onlink-tests.sh
@@ -207,7 +207,7 @@ setup()
 		ip -netns ${PEER_NS} addr add ${V6ADDRS[p${n}]}/64 dev ${NETIFS[p${n}]} nodad
 	done
 
-	ip -6 ro add default via ${V6ADDRS[p3]/::[0-9]/::64}
+	ip -6 ro add default via ${V6ADDRS[p3]/::[0-9]/::64} metric 9999
 	ip -6 ro add table ${VRF_TABLE} default via ${V6ADDRS[p7]/::[0-9]/::64}
 
 	set +e

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251218-rbm-selftests-net-fib-onlink-873ad01e6884

Best regards,
-- 
Ricardo B. Marlière <rbm@suse.com>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route
  2025-12-18 12:20 [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route Ricardo B. Marlière
@ 2025-12-18 16:01 ` David Ahern
  2025-12-19 14:51 ` Fernando Fernandez Mancera
  1 sibling, 0 replies; 5+ messages in thread
From: David Ahern @ 2025-12-18 16:01 UTC (permalink / raw)
  To: Ricardo B. Marlière, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, linux-kselftest, linux-kernel

On 12/18/25 5:20 AM, Ricardo B. Marlière wrote:
> Currently, the test breaks if the SUT already has a default route
> configured for IPv6. Fix by adding "metric 9999" to the `ip -6 ro add`
> command, so that multiple default routes can coexist.
> 
> Fixes: 4ed591c8ab44 ("net/ipv6: Allow onlink routes to have a device mismatch if it is the default route")
> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
> ---
>  tools/testing/selftests/net/fib-onlink-tests.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/fib-onlink-tests.sh b/tools/testing/selftests/net/fib-onlink-tests.sh
> index ec2d6ceb1f08..acf6b0617373 100755
> --- a/tools/testing/selftests/net/fib-onlink-tests.sh
> +++ b/tools/testing/selftests/net/fib-onlink-tests.sh
> @@ -207,7 +207,7 @@ setup()
>  		ip -netns ${PEER_NS} addr add ${V6ADDRS[p${n}]}/64 dev ${NETIFS[p${n}]} nodad
>  	done
>  
> -	ip -6 ro add default via ${V6ADDRS[p3]/::[0-9]/::64}
> +	ip -6 ro add default via ${V6ADDRS[p3]/::[0-9]/::64} metric 9999
>  	ip -6 ro add table ${VRF_TABLE} default via ${V6ADDRS[p7]/::[0-9]/::64}
>  
>  	set +e
> 
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251218-rbm-selftests-net-fib-onlink-873ad01e6884
> 
> Best regards,

The intent of selftests is to run them in a clean environment with known
settings. ie, there should not be a conflicting default route.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route
  2025-12-18 12:20 [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route Ricardo B. Marlière
  2025-12-18 16:01 ` David Ahern
@ 2025-12-19 14:51 ` Fernando Fernandez Mancera
  2025-12-19 15:51   ` David Ahern
  1 sibling, 1 reply; 5+ messages in thread
From: Fernando Fernandez Mancera @ 2025-12-19 14:51 UTC (permalink / raw)
  To: Ricardo B. Marlière, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	David Ahern
  Cc: netdev, linux-kselftest, linux-kernel

On 12/18/25 1:20 PM, Ricardo B. Marlière wrote:
> Currently, the test breaks if the SUT already has a default route
> configured for IPv6. Fix by adding "metric 9999" to the `ip -6 ro add`
> command, so that multiple default routes can coexist.
> 
> Fixes: 4ed591c8ab44 ("net/ipv6: Allow onlink routes to have a device mismatch if it is the default route")
> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
> ---
>   tools/testing/selftests/net/fib-onlink-tests.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/fib-onlink-tests.sh b/tools/testing/selftests/net/fib-onlink-tests.sh
> index ec2d6ceb1f08..acf6b0617373 100755
> --- a/tools/testing/selftests/net/fib-onlink-tests.sh
> +++ b/tools/testing/selftests/net/fib-onlink-tests.sh
> @@ -207,7 +207,7 @@ setup()
>   		ip -netns ${PEER_NS} addr add ${V6ADDRS[p${n}]}/64 dev ${NETIFS[p${n}]} nodad
>   	done
>   
> -	ip -6 ro add default via ${V6ADDRS[p3]/::[0-9]/::64}
> +	ip -6 ro add default via ${V6ADDRS[p3]/::[0-9]/::64} metric 9999
>   	ip -6 ro add table ${VRF_TABLE} default via ${V6ADDRS[p7]/::[0-9]/::64}
> 

It would probably require some work on the test but I think it could 
benefit from using two different network namespaces. Currently it is 
using PEER_NS and the default. I think avoiding the default one is 
beneficial for everyone as it ensures the state is clean and that the 
test won't interrupt the system connectivity.

Other tests already do that, e.g some tests in fib_tests.sh use ns1 and 
ns2 namespaces.

What do you all think?

>   	set +e
> 
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251218-rbm-selftests-net-fib-onlink-873ad01e6884
> 
> Best regards,


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route
  2025-12-19 14:51 ` Fernando Fernandez Mancera
@ 2025-12-19 15:51   ` David Ahern
  2025-12-21 14:59     ` Ricardo B. Marlière
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2025-12-19 15:51 UTC (permalink / raw)
  To: Fernando Fernandez Mancera, Ricardo B. Marlière,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan
  Cc: netdev, linux-kselftest, linux-kernel

On 12/19/25 7:51 AM, Fernando Fernandez Mancera wrote:
> It would probably require some work on the test but I think it could
> benefit from using two different network namespaces. Currently it is
> using PEER_NS and the default. I think avoiding the default one is
> beneficial for everyone as it ensures the state is clean and that the
> test won't interrupt the system connectivity.
> 
> Other tests already do that, e.g some tests in fib_tests.sh use ns1 and
> ns2 namespaces.
> 
> What do you all think?

agreed.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route
  2025-12-19 15:51   ` David Ahern
@ 2025-12-21 14:59     ` Ricardo B. Marlière
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo B. Marlière @ 2025-12-21 14:59 UTC (permalink / raw)
  To: David Ahern, Fernando Fernandez Mancera, Ricardo B. Marlière,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan
  Cc: netdev, linux-kselftest, linux-kernel

On Fri Dec 19, 2025 at 12:51 PM -03, David Ahern wrote:
> On 12/19/25 7:51 AM, Fernando Fernandez Mancera wrote:
>> It would probably require some work on the test but I think it could
>> benefit from using two different network namespaces. Currently it is
>> using PEER_NS and the default. I think avoiding the default one is
>> beneficial for everyone as it ensures the state is clean and that the
>> test won't interrupt the system connectivity.
>> 
>> Other tests already do that, e.g some tests in fib_tests.sh use ns1 and
>> ns2 namespaces.
>> 
>> What do you all think?
>
> agreed.

Thanks, I'll send a new version later on this week then!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-21 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 12:20 [PATCH] selftests: net: fib-onlink-tests: Set high metric for default IPv6 route Ricardo B. Marlière
2025-12-18 16:01 ` David Ahern
2025-12-19 14:51 ` Fernando Fernandez Mancera
2025-12-19 15:51   ` David Ahern
2025-12-21 14:59     ` Ricardo B. Marlière

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox