diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2012-03-27 11:55:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-28 04:45:37 -0400 |
commit | 3b9785c6b0ff37ac4ef5085b38756283da84dceb (patch) | |
tree | 08592027bcbba8ccc9074011868228a9b0f0ab7d | |
parent | 4e7b2f1454382b220f792a7fbcbebd0985187161 (diff) |
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: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/dev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 452db7090d18..723a4065a00e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1597,6 +1597,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | |||
1597 | kfree_skb(skb); | 1597 | kfree_skb(skb); |
1598 | return NET_RX_DROP; | 1598 | return NET_RX_DROP; |
1599 | } | 1599 | } |
1600 | skb->skb_iif = 0; | ||
1600 | skb_set_dev(skb, dev); | 1601 | skb_set_dev(skb, dev); |
1601 | skb->tstamp.tv64 = 0; | 1602 | skb->tstamp.tv64 = 0; |
1602 | skb->pkt_type = PACKET_HOST; | 1603 | skb->pkt_type = PACKET_HOST; |