From: netdev-bot+sashiko@kernel.org
To: liamsmith827@grapheneos.org
Cc: netdev@vger.kernel.org, dsahern@kernel.org, idosch@nvidia.com,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, shuah@kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
liamsmith827@proton.me
Subject: Re: [PATCH net v2 4/4] ipv4: replace obsolete routing comment
Date: Thu, 12 Nov 2026 21:17:16 +0000 [thread overview]
Message-ID: <179451823662.2199510.13028840415362290242@kernel.org> (raw)
In-Reply-To: <20261110061536.10811-5-liamsmith827@grapheneos.org>
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] The comment added to ip_route_output_key_hash_rcu()
(net/ipv4/route.c, in the fib_lookup() error branch) is wrong for one…
--
ipv4: replace obsolete routing comment
This replaces the comment in the fib_lookup() error fallback path of
ip_route_output_key_hash_rcu(). The old comment described obsolete
fib_lookup(), MSG_DONTROUTE and IPv6 behavior. The new one describes
when the on-link fallback is taken.
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 80a2c8a3c571f..ac94d8262b6ed 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2858,24 +2858,19 @@ struct rtable *ip_route_output_key_hash_rcu(struct net *net, struct flowi4 *fl4,
> if (fl4->flowi4_oif &&
> (ipv4_is_multicast(fl4->daddr) ||
> (!fl4->flowi4_l3mdev && err == -ESRCH))) {
> - /* Apparently, routing tables are wrong. Assume,
> - * that the destination is on link.
> + /* When oif is specified, fib_lookup() is called
> + * primarily to determine if the destination is
> + * accessible directly or through a gateway. It also
> + * checks whether there are any traffic restrictions
> + * (blackhole, prohibit, unreachable), or if there's a
> + * routing lookup miss.
> *
[ ... ]
> + * This fallback path is always taken for multicast,
> + * regardless of any restrictions or misses. Non-vrf
> + * unicast does honor restrictions, but falls back if
> + * there's a miss. The destination is assumed on-link
> + * for both.
> */
[Severity: Low]
Is "always taken for multicast" accurate when the oif is an L3 master
(VRF) device?
With a VRF configured, fib_has_custom_rules is set. That sends
fib_lookup() through __fib_lookup(), which changes the caller's flow in
place:
net/ipv4/fib_rules.c:__fib_lookup() {
...
/* update flow if oif or iif point to device enslaved to l3mdev */
l3mdev_update_flow(net, flowi4_to_flowi(flp));
...
}
net/l3mdev/l3mdev.c:l3mdev_update_flow() {
...
if (netif_is_l3_master(dev))
fl->flowi_oif = 0;
...
}
The fallback condition reads fl4->flowi4_oif after the lookup. Take a
multicast daddr that is not link-local and not IGMP (for example 239.x),
with the oif set to the VRF master. If the VRF table lookup fails, for
example on the usual unreachable default route, the oif test is false
and the lookup error is returned. The on-link fallback is not taken.
This behavior predates the patch. Could the comment mention this
exception, and note that the oif test uses the value left after
fib_lookup()?
The opening sentence has the same problem. For a VRF master oif,
fib_lookup() is used to select the VRF table and the oif match is
dropped. It is not mainly a check for whether the destination is direct
or gatewayed. Should the comment say that as well?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261110061536.10811-1-liamsmith827%40grapheneos.org
next prev parent reply other threads:[~2026-11-12 21:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 6:15 [PATCH net v2 0/4] ipv4: restrict on-link fallback to lookup misses liamsmith827
2026-11-10 6:15 ` [PATCH net v2 1/4] ipv4: add FIB_LOOKUP_REPORT_MISS liamsmith827
2026-11-12 19:33 ` Ido Schimmel
2026-11-10 6:15 ` [PATCH net v2 2/4] ipv4: restrict on-link fallback to lookup misses liamsmith827
2026-11-12 17:38 ` Jakub Kicinski
2026-11-12 21:17 ` netdev-bot+sashiko
2026-11-10 6:15 ` [PATCH net v2 3/4] selftests: net: test restricted on-link fallback liamsmith827
2026-11-10 6:15 ` [PATCH net v2 4/4] ipv4: replace obsolete routing comment liamsmith827
2026-11-12 21:17 ` netdev-bot+sashiko [this message]
2026-11-12 17:13 ` [PATCH net v2 0/4] ipv4: restrict on-link fallback to lookup misses Ido Schimmel
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=179451823662.2199510.13028840415362290242@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=liamsmith827@grapheneos.org \
--cc=liamsmith827@proton.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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