diff options
author | Oscar Maes <oscmaes92@gmail.com> | 2025-07-10 16:27:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-20 18:41:08 +0200 |
commit | 7150ea1dadcefe6caf7f050cadba317986a3691f (patch) | |
tree | f92e9d07db0b9fb59194ee4793abc1e238b6e471 | |
parent | f03c9e30bb26153bfb09c8425856b63cd3ce16b4 (diff) |
net: ipv4: fix incorrect MTU in broadcast routes
[ Upstream commit 9e30ecf23b1b8f091f7d08b27968dea83aae7908 ]
Currently, __mkroute_output overrules the MTU value configured for
broadcast routes.
This buggy behaviour can be reproduced with:
ip link set dev eth1 mtu 9000
ip route del broadcast 192.168.0.255 dev eth1 proto kernel scope link src 192.168.0.2
ip route add broadcast 192.168.0.255 dev eth1 proto kernel scope link src 192.168.0.2 mtu 1500
The maximum packet size should be 1500, but it is actually 8000:
ping -b 192.168.0.255 -s 8000
Fix __mkroute_output to allow MTU values to be configured for
for broadcast routes (to support a mixed-MTU local-area-network).
Signed-off-by: Oscar Maes <oscmaes92@gmail.com>
Link: https://patch.msgid.link/20250710142714.12986-1-oscmaes92@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/ipv4/route.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index bd5d48fdd62a..7b8e80c4f1d9 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2586,7 +2586,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res, do_cache = true; if (type == RTN_BROADCAST) { flags |= RTCF_BROADCAST | RTCF_LOCAL; - fi = NULL; } else if (type == RTN_MULTICAST) { flags |= RTCF_MULTICAST | RTCF_LOCAL; if (!ip_check_mc_rcu(in_dev, fl4->daddr, fl4->saddr, |