From: Oscar Maes <oscmaes92@gmail.com>
To: bacs@librecast.net, brett@librecast.net, kuba@kernel.org
Cc: davem@davemloft.net, dsahern@kernel.org, netdev@vger.kernel.org,
regressions@lists.linux.dev, stable@vger.kernel.org,
Oscar Maes <oscmaes92@gmail.com>
Subject: [PATCH net v2 1/2] net: ipv4: fix regression in local-broadcast routes
Date: Tue, 26 Aug 2025 14:17:49 +0200 [thread overview]
Message-ID: <20250826121750.8451-1-oscmaes92@gmail.com> (raw)
In-Reply-To: <20250826121126-oscmaes92@gmail.com>
Commit 9e30ecf23b1b ("net: ipv4: fix incorrect MTU in broadcast routes")
introduced a regression where local-broadcast packets would have their
gateway set in __mkroute_output, which was caused by fi = NULL being
removed.
Fix this by resetting the fib_info for local-broadcast packets. This
preserves the intended changes for directed-broadcast packets.
Cc: stable@vger.kernel.org
Fixes: 9e30ecf23b1b ("net: ipv4: fix incorrect MTU in broadcast routes")
Reported-by: Brett A C Sheffield <bacs@librecast.net>
Closes: https://lore.kernel.org/regressions/20250822165231.4353-4-bacs@librecast.net
Signed-off-by: Oscar Maes <oscmaes92@gmail.com>
---
Thanks to Brett Sheffield for finding the regression and writing
the initial fix!
---
net/ipv4/route.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1f212b2ce4c6..24c898b7654f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2575,12 +2575,16 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
!netif_is_l3_master(dev_out))
return ERR_PTR(-EINVAL);
- if (ipv4_is_lbcast(fl4->daddr))
+ if (ipv4_is_lbcast(fl4->daddr)) {
type = RTN_BROADCAST;
- else if (ipv4_is_multicast(fl4->daddr))
+
+ /* reset fi to prevent gateway resolution */
+ fi = NULL;
+ } else if (ipv4_is_multicast(fl4->daddr)) {
type = RTN_MULTICAST;
- else if (ipv4_is_zeronet(fl4->daddr))
+ } else if (ipv4_is_zeronet(fl4->daddr)) {
return ERR_PTR(-EINVAL);
+ }
if (dev_out->flags & IFF_LOOPBACK)
flags |= RTCF_LOCAL;
--
2.39.5
next prev parent reply other threads:[~2025-08-26 12:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 16:50 [REGRESSION][BISECTED][PATCH] net: ipv4: fix regression in broadcast routes Brett A C Sheffield
2025-08-23 1:32 ` Jakub Kicinski
2025-08-23 12:13 ` [PATCH v2 1/2] selftests: net: add test for broadcast destination Brett A C Sheffield
2025-08-23 12:13 ` [PATCH v2 2/2] net: ipv4: fix regression in broadcast routes Brett A C Sheffield
2025-08-23 12:24 ` [REGRESSION][BISECTED][PATCH] " Brett Sheffield
2025-08-25 6:02 ` Oscar Maes
2025-08-25 6:09 ` [PATCH net 1/2] net: ipv4: fix regression in local-broadcast routes Oscar Maes
2025-08-25 6:09 ` [PATCH net 2/2] selftests: net: add test for destination in broadcast packets Oscar Maes
2025-08-25 7:03 ` Brett A C Sheffield
2025-08-25 22:56 ` [PATCH net 1/2] net: ipv4: fix regression in local-broadcast routes Jakub Kicinski
2025-08-26 12:11 ` Oscar Maes
2025-08-26 12:17 ` Oscar Maes [this message]
2025-08-26 12:17 ` [PATCH net v2 2/2] selftests: net: add test for destination in broadcast packets Oscar Maes
2025-08-27 1:29 ` Jakub Kicinski
2025-08-28 8:17 ` [REGRESSION][BISECTED][PATCH] net: ipv4: fix regression in broadcast routes kernel test robot
2025-08-28 10:35 ` Paolo Abeni
2025-08-28 10:46 ` Brett A C Sheffield
2025-08-29 2:08 ` Oliver Sang
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=20250826121750.8451-1-oscmaes92@gmail.com \
--to=oscmaes92@gmail.com \
--cc=bacs@librecast.net \
--cc=brett@librecast.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=regressions@lists.linux.dev \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).