+++ /dev/null
-From 5189446ba995556eaa3755a6e875bc06675b88bd Mon Sep 17 00:00:00 2001
-From: Oscar Maes <oscmaes92@gmail.com>
-Date: Wed, 27 Aug 2025 08:23:21 +0200
-Subject: [PATCH] net: ipv4: fix regression in local-broadcast routes
-
-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>
-Reviewed-by: David Ahern <dsahern@kernel.org>
-Link: https://patch.msgid.link/20250827062322.4807-1-oscmaes92@gmail.com
-Signed-off-by: Paolo Abeni <pabeni@redhat.com>
----
- net/ipv4/route.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
---- a/net/ipv4/route.c
-+++ b/net/ipv4/route.c
-@@ -2547,12 +2547,16 @@ static struct rtable *__mkroute_output(c
- !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;
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -2541,9 +2541,13 @@ static void stmmac_bump_dma_threshold(st
+@@ -2542,9 +2542,13 @@ static void stmmac_bump_dma_threshold(st
* @priv: driver private structure
* @budget: napi budget limiting this functions packet handling
* @queue: TX queue index
{
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
-@@ -2703,7 +2707,7 @@ static int stmmac_tx_clean(struct stmmac
+@@ -2704,7 +2708,7 @@ static int stmmac_tx_clean(struct stmmac
/* We still have pending packets, let's call for a new scheduling */
if (tx_q->dirty_tx != tx_q->cur_tx)
u64_stats_update_begin(&txq_stats->napi_syncp);
u64_stats_add(&txq_stats->napi.tx_packets, tx_packets);
-@@ -5609,6 +5613,7 @@ static int stmmac_napi_poll_tx(struct na
+@@ -5611,6 +5615,7 @@ static int stmmac_napi_poll_tx(struct na
container_of(napi, struct stmmac_channel, tx_napi);
struct stmmac_priv *priv = ch->priv_data;
struct stmmac_txq_stats *txq_stats;
u32 chan = ch->index;
int work_done;
-@@ -5617,7 +5622,7 @@ static int stmmac_napi_poll_tx(struct na
+@@ -5619,7 +5624,7 @@ static int stmmac_napi_poll_tx(struct na
u64_stats_inc(&txq_stats->napi.poll);
u64_stats_update_end(&txq_stats->napi_syncp);
work_done = min(work_done, budget);
if (work_done < budget && napi_complete_done(napi, work_done)) {
-@@ -5628,6 +5633,10 @@ static int stmmac_napi_poll_tx(struct na
+@@ -5630,6 +5635,10 @@ static int stmmac_napi_poll_tx(struct na
spin_unlock_irqrestore(&ch->lock, flags);
}
return work_done;
}
-@@ -5636,6 +5645,7 @@ static int stmmac_napi_poll_rxtx(struct
+@@ -5638,6 +5647,7 @@ static int stmmac_napi_poll_rxtx(struct
struct stmmac_channel *ch =
container_of(napi, struct stmmac_channel, rxtx_napi);
struct stmmac_priv *priv = ch->priv_data;
int rx_done, tx_done, rxtx_done;
struct stmmac_rxq_stats *rxq_stats;
struct stmmac_txq_stats *txq_stats;
-@@ -5651,7 +5661,7 @@ static int stmmac_napi_poll_rxtx(struct
+@@ -5653,7 +5663,7 @@ static int stmmac_napi_poll_rxtx(struct
u64_stats_inc(&txq_stats->napi.poll);
u64_stats_update_end(&txq_stats->napi_syncp);
tx_done = min(tx_done, budget);
rx_done = stmmac_rx_zc(priv, budget, chan);
-@@ -5676,6 +5686,10 @@ static int stmmac_napi_poll_rxtx(struct
+@@ -5678,6 +5688,10 @@ static int stmmac_napi_poll_rxtx(struct
spin_unlock_irqrestore(&ch->lock, flags);
}