Thread (18 messages) 18 messages, 6 authors, 2025-08-29

Re: [PATCH net 1/2] net: ipv4: fix regression in local-broadcast routes

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-08-25 22:56:31
Also in: regressions, stable

On Mon, 25 Aug 2025 08:09:17 +0200 Oscar Maes wrote:
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.
Meaning that 9e30ecf23b1b would still change behavior for the subnet
broadcast address?
quoted hunk ↗ jump to hunk
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f639a2ae881a..98d237e3ec04 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2575,9 +2575,12 @@ 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))
 		return ERR_PTR(-EINVAL);
nit: please add curly braces around all branches of this if / else if /
else ladder, per kernel coding style guide.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help