mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
tunnels: harmonize cleanup done on skb on rx path
The goal of this patch is to harmonize cleanup done on a skbuff on rx path. Before this patch, behaviors were different depending of the tunnel type. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
963a88b31d
commit
ea23192e8e
7 changed files with 13 additions and 26 deletions
|
@ -311,11 +311,13 @@ static inline void skb_dst_force(struct sk_buff *skb)
|
|||
* __skb_tunnel_rx - prepare skb for rx reinsert
|
||||
* @skb: buffer
|
||||
* @dev: tunnel device
|
||||
* @net: netns for packet i/o
|
||||
*
|
||||
* After decapsulation, packet is going to re-enter (netif_rx()) our stack,
|
||||
* so make some cleanups. (no accounting done)
|
||||
*/
|
||||
static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
|
||||
static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
|
||||
struct net *net)
|
||||
{
|
||||
skb->dev = dev;
|
||||
|
||||
|
@ -327,8 +329,7 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
|
|||
if (!skb->l4_rxhash)
|
||||
skb->rxhash = 0;
|
||||
skb_set_queue_mapping(skb, 0);
|
||||
skb_dst_drop(skb);
|
||||
nf_reset(skb);
|
||||
skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -340,12 +341,13 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
|
|||
* so make some cleanups, and perform accounting.
|
||||
* Note: this accounting is not SMP safe.
|
||||
*/
|
||||
static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
|
||||
static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
|
||||
struct net *net)
|
||||
{
|
||||
/* TODO : stats should be SMP safe */
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += skb->len;
|
||||
__skb_tunnel_rx(skb, dev);
|
||||
__skb_tunnel_rx(skb, dev, net);
|
||||
}
|
||||
|
||||
/* Children define the path of the packet through the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue