net: mctp: unconditionally set skb->dev on dst output
Jeremy Kerr
maintainerPATCH 1/1 net: mctp: unconditionally set skb->dev on dst output
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.
--- net/mctp/route.c | 1 + 1 file changed, 1 insertion(+)
net/mctp/route.c +1 -0
@@ -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);
---
base-commit: 4c19c4fa8dabb945a017c1910605ab2616725c6c
change-id: 20251125-dev-forward-932c006dec72
Best regards,
Signature · 1 line
Jeremy Kerr <[email protected]>
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 10 lines · On Tue, 25 Nov 2025 14:48:54 +0800 you wrote:
On transmit, we are currently relying on
skb->devbeing set bymctp_local_output()when we first set up the skb destination fields. However, forwarded skbs do not use thelocal_outputpath, so will retain their incoming netdev as their ->dev on tx. This does not work when we're forwarding between interfaces.Set
skb->devunconditionally in the transmit path, to allow for proper forwarding.[...]
Here is the summary with links:
- [net] net: mctp: unconditionally set skb->dev on dst output
https://git.kernel.org/netdev/net/c/b3e528a5811b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html