]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: fib-onlink: Add test cases for nexthop device mismatch
authorIdo Schimmel <idosch@nvidia.com>
Sun, 11 Jan 2026 12:08:13 +0000 (14:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Jan 2026 02:57:35 +0000 (18:57 -0800)
commitf8f9ee9d8b2ed1f29309399020f2fc30f7f93035
treedd760e9fd3a9661d8a40f2e53ed46013e621793f
parentb853b94e848216b82ecaa0d5d3c7f6c9066e32a4
selftests: fib-onlink: Add test cases for nexthop device mismatch

Add test cases that verify that when the "onlink" keyword is specified,
both address families (with and without VRF) accept routes with a
gateway address that is reachable via a different interface than the one
specified.

Output without "ipv6: Allow for nexthop device mismatch with "onlink"":

 # ./fib-onlink-tests.sh | grep mismatch
 TEST: nexthop device mismatch                             [ OK ]
 TEST: nexthop device mismatch                             [ OK ]
 TEST: nexthop device mismatch                             [FAIL]
 TEST: nexthop device mismatch                             [FAIL]

Output with "ipv6: Allow for nexthop device mismatch with "onlink"":

 # ./fib-onlink-tests.sh | grep mismatch
 TEST: nexthop device mismatch                             [ OK ]
 TEST: nexthop device mismatch                             [ OK ]
 TEST: nexthop device mismatch                             [ OK ]
 TEST: nexthop device mismatch                             [ OK ]

That is, the IPv4 tests were always passing, but the IPv6 ones only pass
after the specified patch.

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-6-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/fib-onlink-tests.sh