From: David Ahern <dsahern@kernel.org>
To: Ido Schimmel <idosch@nvidia.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, horms@kernel.org, petrm@nvidia.com
Subject: Re: [PATCH net-next 1/5] selftests: fib-onlink: Remove "wrong nexthop device" IPv4 tests
Date: Mon, 12 Jan 2026 08:25:31 -0700 [thread overview]
Message-ID: <e4368ed8-154d-4656-838f-4005287d4394@kernel.org> (raw)
In-Reply-To: <20260111120813.159799-2-idosch@nvidia.com>
On 1/11/26 5:08 AM, Ido Schimmel wrote:
> According to the test description, these tests fail because of a wrong
> nexthop device:
>
> # ./fib-onlink-tests.sh -v
> [...]
> COMMAND: ip ro add table 254 169.254.101.102/32 via 169.254.3.1 dev veth1 onlink
> Error: Nexthop has invalid gateway.
>
> TEST: Gateway resolves to wrong nexthop device [ OK ]
> COMMAND: ip ro add table 1101 169.254.102.103/32 via 169.254.7.1 dev veth5 onlink
> Error: Nexthop has invalid gateway.
>
> TEST: Gateway resolves to wrong nexthop device - VRF [ OK ]
> [...]
>
> But this is incorrect. They fail because the gateway addresses are local
> addresses:
>
> # ip -4 address show
> [...]
> 28: veth3@if27: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link-netns peer_ns-Urqh3o
> inet 169.254.3.1/24 scope global veth3
> [...]
> 32: veth7@if31: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lisa state UP group default qlen 1000 link-netns peer_ns-Urqh3o
> inet 169.254.7.1/24 scope global veth7
>
> Therefore, using a local address that matches the nexthop device fails
> as well:
>
> # ip ro add table 254 169.254.101.102/32 via 169.254.3.1 dev veth3 onlink
> Error: Nexthop has invalid gateway.
>
> Using a gateway address with a "wrong" nexthop device is actually valid
> and allowed:
>
> # ip route get 169.254.1.2
> 169.254.1.2 dev veth1 src 169.254.1.1 uid 0
> # ip ro add table 254 169.254.101.102/32 via 169.254.1.2 dev veth3 onlink
> # echo $?
> 0
>
> Remove these tests given that their output is confusing and that the
> scenario that they are testing is already covered by other tests.
>
> A subsequent patch will add tests for the nexthop device mismatch
> scenario.
>
> Reviewed-by: Petr Machata <petrm@nvidia.com>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> tools/testing/selftests/net/fib-onlink-tests.sh | 6 ------
> 1 file changed, 6 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2026-01-12 15:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-11 12:08 [PATCH net-next 0/5] ipv6: Allow for nexthop device mismatch with "onlink" Ido Schimmel
2026-01-11 12:08 ` [PATCH net-next 1/5] selftests: fib-onlink: Remove "wrong nexthop device" IPv4 tests Ido Schimmel
2026-01-12 15:25 ` David Ahern [this message]
2026-01-11 12:08 ` [PATCH net-next 2/5] selftests: fib-onlink: Remove "wrong nexthop device" IPv6 tests Ido Schimmel
2026-01-12 15:25 ` David Ahern
2026-01-11 12:08 ` [PATCH net-next 3/5] selftests: fib-onlink: Add a test case for IPv4 multicast gateway Ido Schimmel
2026-01-12 15:26 ` David Ahern
2026-01-11 12:08 ` [PATCH net-next 4/5] ipv6: Allow for nexthop device mismatch with "onlink" Ido Schimmel
2026-01-12 15:29 ` David Ahern
2026-01-11 12:08 ` [PATCH net-next 5/5] selftests: fib-onlink: Add test cases for nexthop device mismatch Ido Schimmel
2026-01-12 15:31 ` David Ahern
2026-01-14 3:00 ` [PATCH net-next 0/5] ipv6: Allow for nexthop device mismatch with "onlink" patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4368ed8-154d-4656-838f-4005287d4394@kernel.org \
--to=dsahern@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox