Re: [PATCH v2 2/3] selftests: fib_nexthops: Check the IPv6 multipath source address

From: netdev-bot+sashiko

Date: Fri Dec 04 2026 - 19:37:38 EST


Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In ipv6_mpath_select()
(tools/testing/selftests/net/fib_nexthops.sh), the new "Source address…

--

selftests: fib_nexthops: Check the IPv6 multipath source address

This commit extends ipv6_mpath_select() in fib_nexthops.sh. For a
destination hashed to each member of a multipath nexthop group, the test
now checks that the reported source address belongs to the device of the
selected nexthop.

> diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh
> index adbec51917eb8..cdc8d53d87acf 100755
> --- a/tools/testing/selftests/net/fib_nexthops.sh
> +++ b/tools/testing/selftests/net/fib_nexthops.sh

[ ... ]

> @@ -867,6 +877,31 @@ ipv6_mpath_select()
> done
> log_test $rc 0 "Use valid neighbor during multipath selection"
>
> + # The source address must belong to the selected nexthop's device,
> + # not the device of the group's first nexthop.
> + local -A srcs
> + srcs=([veth1]=2001:db8:91::1 [veth3]=2001:db8:92::1)
> + rc=0
> + for dev in veth1 veth3; do

[ ... ]

> + if ! check_output "$(get_route_prefsrc "$addr")" "${srcs[$dev]}"; then
> + rc=1
> + break
> + fi
> + done
> + log_test $rc 0 "Source address of selected multipath nexthop"
> +
> run_cmd "$IP neigh add 2001:db8:91::2 dev veth1 nud incomplete"
> run_cmd "$IP neigh add 2001:db8:92::2 dev veth3 nud incomplete"
> run_cmd "$IP route get 2001:db8:101::1"

[Severity: Low]
When the new prefsrc check fails, does the failure also show up under the
"Multipath selection with no valid neighbor" test?

The sub-test that follows in ipv6_mpath_select() never resets or
recomputes rc. It throws away the exit status of its run_cmd calls and
then reports whatever rc already holds:

run_cmd "$IP route get 2001:db8:101::1"
# if we did not crash, success
log_test $rc 0 "Multipath selection with no valid neighbor"

So if check_output() fails for either veth1 or veth3, rc=1 is still set
when this log_test runs. That gives a second FAIL line and another nfail
increment, and the failure is reported against the crash-only test.

The commit message says the new check is expected to fail on kernels
without "ipv6: Use the selected nexthop for source address selection".
That makes this case likely, for example when only the selftest is
backported.

This stale rc reuse existed before this patch, since the first sub-test's
rc used to carry into the last one. This patch changes which result
carries over, and that result can now be an expected failure.

Would it make sense to reset rc=0 before the "no valid neighbor" sub-test,
or to set rc from the exit status of the run_cmd "$IP route get
2001:db8:101::1" call?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203234720.2428689-1-tmenninger%40everpuredata.com