diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-02 01:19:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-03 05:51:04 -0400 |
commit | adf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch) | |
tree | 0f07542bb95de2ad537540868aba6cf87a86e17d /net/xfrm/xfrm_policy.c | |
parent | 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (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 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 9c068ab3a834..cb81ca35b0d6 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2027,6 +2027,8 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2027 | { | 2027 | { |
2028 | struct net *net = dev_net(skb->dev); | 2028 | struct net *net = dev_net(skb->dev); |
2029 | struct flowi fl; | 2029 | struct flowi fl; |
2030 | struct dst_entry *dst; | ||
2031 | int res; | ||
2030 | 2032 | ||
2031 | if (xfrm_decode_session(skb, &fl, family) < 0) { | 2033 | if (xfrm_decode_session(skb, &fl, family) < 0) { |
2032 | /* XXX: we should have something like FWDHDRERROR here. */ | 2034 | /* XXX: we should have something like FWDHDRERROR here. */ |
@@ -2034,7 +2036,11 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2034 | return 0; | 2036 | return 0; |
2035 | } | 2037 | } |
2036 | 2038 | ||
2037 | return xfrm_lookup(net, &skb->dst, &fl, NULL, 0) == 0; | 2039 | dst = skb_dst(skb); |
2040 | |||
2041 | res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0; | ||
2042 | skb_dst_set(skb, dst); | ||
2043 | return res; | ||
2038 | } | 2044 | } |
2039 | EXPORT_SYMBOL(__xfrm_route_forward); | 2045 | EXPORT_SYMBOL(__xfrm_route_forward); |
2040 | 2046 | ||