summaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorEric Dumazet2009-06-02 07:19:30 +0200
committerDavid S. Miller2009-06-03 11:51:04 +0200
commitadf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch)
tree0f07542bb95de2ad537540868aba6cf87a86e17d /include/linux/skbuff.h
parentnet: skb->rtable accessor (diff)
downloadkernel-qcow2-linux-adf30907d63893e4208dfe3f5c88ae12bc2f25d5.tar.gz
kernel-qcow2-linux-adf30907d63893e4208dfe3f5c88ae12bc2f25d5.tar.xz
kernel-qcow2-linux-adf30907d63893e4208dfe3f5c88ae12bc2f25d5.zip
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/skbuff.h')
-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 {
struct net_device *dev;
union {
- struct dst_entry *dst;
unsigned long _skb_dst;
};
#ifdef CONFIG_XFRM
@@ -426,9 +425,19 @@ extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
enum dma_data_direction dir);
#endif
+static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
+{
+ return (struct dst_entry *)skb->_skb_dst;
+}
+
+static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
+{
+ skb->_skb_dst = (unsigned long)dst;
+}
+
static inline struct rtable *skb_rtable(const struct sk_buff *skb)
{
- return (struct rtable *)skb->_skb_dst;
+ return (struct rtable *)skb_dst(skb);
}
extern void kfree_skb(struct sk_buff *skb);