]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: fib-onlink: Remove "wrong nexthop device" IPv6 tests
authorIdo Schimmel <idosch@nvidia.com>
Sun, 11 Jan 2026 12:08:10 +0000 (14:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Jan 2026 02:57:34 +0000 (18:57 -0800)
The command in the test fails as expected because IPv6 forbids a nexthop
device mismatch:

 # ./fib-onlink-tests.sh -v
 [...]
 COMMAND: ip -6 ro add table 1101 2001:db8:102::103/128 via 2001:db8:701::64 dev veth5 onlink
 Error: Nexthop has invalid gateway or device mismatch.

 TEST: Gateway resolves to wrong nexthop device - VRF      [ OK ]
 [...]

Where:

 # ip route get 2001:db8:701::64 vrf lisa
 2001:db8:701::64 dev veth7 table 1101 proto kernel src 2001:db8:701::1 metric 256 pref medium

This is in contrast to IPv4 where a nexthop device mismatch is allowed
when "onlink" is specified:

 # ip route get 169.254.7.2 vrf lisa
 169.254.7.2 dev veth7 table 1101 src 169.254.7.1 uid 0
 # ip ro add table 1101 169.254.102.103/32 via 169.254.7.2 dev veth5 onlink
 # echo $?
 0

Remove these tests in preparation for aligning IPv6 with IPv4 and
allowing nexthop device mismatch when "onlink" is specified.

A subsequent patch will add tests that verify that both address families
allow a nexthop device mismatch with "onlink".

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260111120813.159799-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/fib-onlink-tests.sh

index 1bb1c2289650fce01b7cfaaee7c732525b3e4a87..63477be859e3e3983ca1c417bfe6ed2897bb07b1 100755 (executable)
@@ -432,13 +432,6 @@ invalid_onlink_ipv6()
 
        run_ip6 254 ${TEST_NET6[1]}::101 ${V6ADDRS[p1]} "" 2 \
                "No nexthop device given"
-
-       # default VRF validation is done against LOCAL table
-       # run_ip6 254 ${TEST_NET6[1]}::102 ${V6ADDRS[p3]/::[0-9]/::64} ${NETIFS[p1]} 2 \
-       #       "Gateway resolves to wrong nexthop device"
-
-       run_ip6 ${VRF_TABLE} ${TEST_NET6[2]}::103 ${V6ADDRS[p7]/::[0-9]/::64} ${NETIFS[p5]} 2 \
-               "Gateway resolves to wrong nexthop device - VRF"
 }
 
 run_onlink_tests()