diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2013-06-26 16:11:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-27 22:29:05 -0700 |
commit | 621e84d6f373dcb273ebfd772638b8e7dc3c2c48 (patch) | |
tree | 55135ee5450006f25cca4f14c8206524f976149b /net/core/dev.c | |
parent | 38ae92dc215e939897f17861d658f882d0eaab0f (diff) |
dev: introduce skb_scrub_packet()
The goal of this new function is to perform all needed cleanup before sending
an skb into another netns.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 722f633926e0..370354a9c5f6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1652,22 +1652,13 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) } } - skb_orphan(skb); - if (unlikely(!is_skb_forwardable(dev, skb))) { atomic_long_inc(&dev->rx_dropped); kfree_skb(skb); return NET_RX_DROP; } - skb->skb_iif = 0; - skb_dst_drop(skb); - skb->tstamp.tv64 = 0; - skb->pkt_type = PACKET_HOST; + skb_scrub_packet(skb); skb->protocol = eth_type_trans(skb, dev); - skb->mark = 0; - secpath_reset(skb); - nf_reset(skb); - nf_reset_trace(skb); return netif_rx(skb); } EXPORT_SYMBOL_GPL(dev_forward_skb); |