aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2013-09-02 09:34:58 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-04 00:27:26 -0400
commitea23192e8e577dfc51e0f4fc5ca113af334edff9 (patch)
tree3568561a6128c5395dc0cf1b0f105e313d848d9b /include
parent963a88b31ddbbe99f38502239b1a46601773d217 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/net/dst.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 1f8fd109e225..3bc4865f8267 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -311,11 +311,13 @@ static inline void skb_dst_force(struct sk_buff *skb)
311 * __skb_tunnel_rx - prepare skb for rx reinsert 311 * __skb_tunnel_rx - prepare skb for rx reinsert
312 * @skb: buffer 312 * @skb: buffer
313 * @dev: tunnel device 313 * @dev: tunnel device
314 * @net: netns for packet i/o
314 * 315 *
315 * After decapsulation, packet is going to re-enter (netif_rx()) our stack, 316 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
316 * so make some cleanups. (no accounting done) 317 * so make some cleanups. (no accounting done)
317 */ 318 */
318static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 319static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
320 struct net *net)
319{ 321{
320 skb->dev = dev; 322 skb->dev = dev;
321 323
@@ -327,8 +329,7 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
327 if (!skb->l4_rxhash) 329 if (!skb->l4_rxhash)
328 skb->rxhash = 0; 330 skb->rxhash = 0;
329 skb_set_queue_mapping(skb, 0); 331 skb_set_queue_mapping(skb, 0);
330 skb_dst_drop(skb); 332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
331 nf_reset(skb);
332} 333}
333 334
334/** 335/**
@@ -340,12 +341,13 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
340 * so make some cleanups, and perform accounting. 341 * so make some cleanups, and perform accounting.
341 * Note: this accounting is not SMP safe. 342 * Note: this accounting is not SMP safe.
342 */ 343 */
343static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 344static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
345 struct net *net)
344{ 346{
345 /* TODO : stats should be SMP safe */ 347 /* TODO : stats should be SMP safe */
346 dev->stats.rx_packets++; 348 dev->stats.rx_packets++;
347 dev->stats.rx_bytes += skb->len; 349 dev->stats.rx_bytes += skb->len;
348 __skb_tunnel_rx(skb, dev); 350 __skb_tunnel_rx(skb, dev, net);
349} 351}
350 352
351/* Children define the path of the packet through the 353/* Children define the path of the packet through the