summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2025-11-25 14:48:54 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 06:27:32 +0900
commitd5796cf53b0802ea60eb2aa9b84ee7aa8ba18350 (patch)
tree1c3412a2cf2ec5f353d4869cd2ec8b96e546668b /net
parent64e47cd1fd631a21bf5a630cebefec6c8fc381cd (diff)
downloadlinux-d5796cf53b0802ea60eb2aa9b84ee7aa8ba18350.tar.gz
linux-d5796cf53b0802ea60eb2aa9b84ee7aa8ba18350.tar.bz2
linux-d5796cf53b0802ea60eb2aa9b84ee7aa8ba18350.zip
net: mctp: unconditionally set skb->dev on dst output
[ Upstream commit b3e528a5811bbc8246dbdb962f0812dc9b721681 ] On transmit, we are currently relying on skb->dev being set by mctp_local_output() when we first set up the skb destination fields. However, forwarded skbs do not use the local_output path, so will retain their incoming netdev as their ->dev on tx. This does not work when we're forwarding between interfaces. Set skb->dev unconditionally in the transmit path, to allow for proper forwarding. We keep the skb->dev initialisation in mctp_local_output(), as we use it for fragmentation. Fixes: 269936db5eb3 ("net: mctp: separate routing database from routing operations") Suggested-by: Vince Chang <vince_chang@aspeedtech.com> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20251125-dev-forward-v1-1-54ecffcd0616@codeconstruct.com.au Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/mctp/route.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mctp/route.c b/net/mctp/route.c
index 4d314e062ba9..2ac4011a953f 100644
--- a/net/mctp/route.c
+++ b/net/mctp/route.c
@@ -623,6 +623,7 @@ static int mctp_dst_output(struct mctp_dst *dst, struct sk_buff *skb)
skb->protocol = htons(ETH_P_MCTP);
skb->pkt_type = PACKET_OUTGOING;
+ skb->dev = dst->dev->dev;
if (skb->len > dst->mtu) {
kfree_skb(skb);