提交 3b9785c6 编写于 作者: B Benjamin LaHaise 提交者: David S. Miller

net/core: dev_forward_skb() should clear skb_iif

While investigating another bug, I found that the code on the incoming path
in __netif_receive_skb will only set skb->skb_iif if it is already 0.  When
dev_forward_skb() is used in the case of interfaces like veth, skb_iif may
already have been set.  Making dev_forward_skb() cause the packet to look
like a newly received packet would seem to the the correct behaviour here,
as otherwise the wrong incoming interface can be reported for such a packet.
Signed-off-by: NBenjamin LaHaise <bcrl@kvack.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4e7b2f14
...@@ -1597,6 +1597,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) ...@@ -1597,6 +1597,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
kfree_skb(skb); kfree_skb(skb);
return NET_RX_DROP; return NET_RX_DROP;
} }
skb->skb_iif = 0;
skb_set_dev(skb, dev); skb_set_dev(skb, dev);
skb->tstamp.tv64 = 0; skb->tstamp.tv64 = 0;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册