On Tue, 1 Sep 2026 16:18:56 +0200
Alessio Faina <[email protected]> wrote:
> [snip]
>
Hi Alessio,
Thanks. Some comments below.
> I tried this
>
> +test_iproute2_vrftable_supp_or_ksft_skip()
> +{
> + ip netns add __vrftable_test 2>/dev/null
The netns name is fixed, and if a netns with that name exists, the
check runs in it and deletes it at the end. It would be better to use
setup_ns with a local variable. setup_ns picks a random name, fills
the variable and checks the add. cleanup_ns then removes the namespace.
> + ip netns exec __vrftable_test sh -c "echo 1 >
> /proc/sys/net/vrf/strict_mode"
> + ip -netns __vrftable_test link add vrf-100 type vrf table 100
> + ip -netns __vrftable_test link set vrf-100 up
> + if ! ip -netns __vrftable_test -6 route add fc00::1/128 \
> + encap seg6local action End.DT4 vrftable 100 dev vrf-100
> 2>/dev/null; then
> + ip netns del __vrftable_test 2>/dev/null
> + echo "SKIP: SRv6 vrftable not supported in iproute2"
The srv6 tests that name iproute2 grep the ip help text, while this one
installs a route. IMO the message should say what is missing:
"SKIP: SRv6 End.DT4 vrftable not supported", and the same for the function
name, without iproute2 in it.
> + exit "${ksft_skip}"
> + fi
> + ip netns del __vrftable_test 2>/dev/null
> +}
> +
> +test_iproute2_vrftable_supp_or_ksft_skip
> +
The call goes after the vrf block and before setup(), because the check
writes the vrf sysctl and that file is not there without the module.
The commit message and the subject should be updated as well.
Ciao,
Andrea