Re: [PATCH net-next v4 1/3] ipv4: Check a Fragmentation Needed against each path of a multipath route
From: Ido Schimmel
Date: Mon Nov 23 2026 - 07:11:26 EST
On Tue, Nov 17, 2026 at 10:31:39PM +0300, Vladimir Vdovin wrote:
> Since commit 7d3f3b4367f3 ("net: ipv4: Cache pmtu for all packet paths
> if multipath enabled") the mtu of a Fragmentation Needed is cached on
> every path of a multipath route, as the lookup for it may land on
> another path than the one the flow is on. But the mtu is still checked
> against that one path only, by the early returns on the looked-up dst:
>
> - a path whose mtu or pmtu is lower gets a pmtu above what it can
> carry, its flows blackhole until the exception expires
> - a mtu locked for being below ip_rt_min_pmtu is written as is, over a
> lower device mtu or locked pmtu
> - a looked-up path narrower than the mtu, or already at it, ends the
> update before the path of the flow has learned anything
>
> Check the mtu against each path instead, what it uses now as ipv4_mtu()
> reports it: cache the mtu only where it is lower, cap a locked mtu to
> it, leave a locked pmtu alone. The checks on the dst stay for the other
> callers, sockets and tunnels, whose dst is the path of their flow. A
> Fragmentation Needed that changes nothing costs the ICMP callers a fib
> lookup and a look at the exception of each path.
>
> Fixes: 7d3f3b4367f3 ("net: ipv4: Cache pmtu for all packet paths if multipath enabled")
> Signed-off-by: Vladimir Vdovin <deliran@xxxxxxxxxx>
> ---
> net/ipv4/route.c | 90 +++++++++++++++++++++++++++++++++---------------
> 1 file changed, 63 insertions(+), 27 deletions(-)
This seems too complicated for something that should only happen with an
unusual configuration (nexthop devices with different MTU).
Let's say that we have a nexthop group with two nexthops:
A - device MTU 900
B - device MTU 1500
And that the PMTU to destination D is 1000. AFAIU, there are two cases:
1. We get a PTB and look up a dst entry on A. We see that the current
path MTU (900) is lower and return early without creating an exception
for destination D on B.
This can only happen if the PTB lookup hashes differently than the flow
(e.g., non-default hash policy), it never worked (even before
7d3f3b4367f3) and it also requires the PMTU to be between the MTUs of
both nexthops.
2. We get a PTB and look up a dst entry on B. We resolve the nexthop
group and create an exception for D with PMTU of 1000 on both A and B,
despite the fact that A's device MTU is lower (900 < 1000). Packets
destined to D that resolve to path A are therefore dropped.
Like the first case, this case also requires the PMTU to be between the
MTUs of both nexthops.
The second case can be fixed with something like [1]. The new IPv4
selftest passes with it and fails without it.
Can you send [1] instead of the current patch and mention in the commit
message that the first case is ignored since it requires a complicated
fix, never worked and requires a very unusual setup?
I think that patch can be targeted at net-next without a Fixes tag, as
even the second case requires a very specific configuration and nobody
has reported it.
[1]
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d0a5f6d77094..205921567634 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1085,6 +1085,8 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
nhc = fib_info_nhc(res.fi, nhsel);
if (!nhc)
break;
+ if (mtu > READ_ONCE(nhc->nhc_dev->mtu))
+ continue;
update_or_create_fnhe(nhc, fl4->daddr, 0, mtu, lock,
jiffies + net->ipv4.ip_rt_mtu_expires);
}