aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-06-02 01:19:30 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-03 05:51:04 -0400
commitadf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch)
tree0f07542bb95de2ad537540868aba6cf87a86e17d /include/linux
parent511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (diff)
net: skb->dst accessors
Define three accessors to get/set dst attached to a skb struct dst_entry *skb_dst(const struct sk_buff *skb) void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) void skb_dst_drop(struct sk_buff *skb) This one should replace occurrences of : dst_release(skb->dst) skb->dst = NULL; Delete skb->dst field Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/skbuff.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a3ae3c525833..9ef6eb20247b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -323,7 +323,6 @@ struct sk_buff {
323 struct net_device *dev; 323 struct net_device *dev;
324 324
325 union { 325 union {
326 struct dst_entry *dst;
327 unsigned long _skb_dst; 326 unsigned long _skb_dst;
328 }; 327 };
329#ifdef CONFIG_XFRM 328#ifdef CONFIG_XFRM
@@ -426,9 +425,19 @@ extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
426 enum dma_data_direction dir); 425 enum dma_data_direction dir);
427#endif 426#endif
428 427
428static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
429{
430 return (struct dst_entry *)skb->_skb_dst;
431}
432
433static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
434{
435 skb->_skb_dst = (unsigned long)dst;
436}
437
429static inline struct rtable *skb_rtable(const struct sk_buff *skb) 438static inline struct rtable *skb_rtable(const struct sk_buff *skb)
430{ 439{
431 return (struct rtable *)skb->_skb_dst; 440 return (struct rtable *)skb_dst(skb);
432} 441}
433 442
434extern void kfree_skb(struct sk_buff *skb); 443extern void kfree_skb(struct sk_buff *skb);