aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-05-18 01:36:55 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-18 01:36:55 -0400
commitd19d56ddc88e7895429ef118db9c83c7bbe3ce6a (patch)
treec0db76f3527c88c95a8793c871f62d628fb3fd1d /include/net/dst.h
parentde213e5eedecdfb1b1eea7e6be28bc64cac5c078 (diff)
net: Introduce skb_tunnel_rx() helper
skb rxhash should be cleared when a skb is handled by a tunnel before being delivered again, so that correct packet steering can take place. There are other cleanups and accounting that we can factorize in a new helper, skb_tunnel_rx() Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 27207a13f2a6..612069beda73 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -226,6 +226,26 @@ static inline void skb_dst_force(struct sk_buff *skb)
226 } 226 }
227} 227}
228 228
229
230/**
231 * skb_tunnel_rx - prepare skb for rx reinsert
232 * @skb: buffer
233 * @dev: tunnel device
234 *
235 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
236 * so make some cleanups, and perform accounting.
237 */
238static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
239{
240 skb->dev = dev;
241 /* TODO : stats should be SMP safe */
242 dev->stats.rx_packets++;
243 dev->stats.rx_bytes += skb->len;
244 skb->rxhash = 0;
245 skb_dst_drop(skb);
246 nf_reset(skb);
247}
248
229/* Children define the path of the packet through the 249/* Children define the path of the packet through the
230 * Linux networking. Thus, destinations are stackable. 250 * Linux networking. Thus, destinations are stackable.
231 */ 251 */