summaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-06-02 05:19:30 +0000
committerDavid S. Miller <davem@davemloft.net>2009-06-03 02:51:04 -0700
commitadf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch)
tree0f07542bb95de2ad537540868aba6cf87a86e17d /net/dccp/ipv6.c
parent511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (diff)
downloadlinux-adf30907d63893e4208dfe3f5c88ae12bc2f25d5.tar.gz
linux-adf30907d63893e4208dfe3f5c88ae12bc2f25d5.tar.bz2
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 'net/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index b963f35c65f6..05ea7440d9e5 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -314,8 +314,9 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
struct ipv6hdr *rxip6h;
struct sk_buff *skb;
struct flowi fl;
- struct net *net = dev_net(rxskb->dst->dev);
+ struct net *net = dev_net(skb_dst(rxskb)->dev);
struct sock *ctl_sk = net->dccp.v6_ctl_sk;
+ struct dst_entry *dst;
if (dccp_hdr(rxskb)->dccph_type == DCCP_PKT_RESET)
return;
@@ -342,8 +343,9 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
security_skb_classify_flow(rxskb, &fl);
/* sk = NULL, but it is safe for now. RST socket required. */
- if (!ip6_dst_lookup(ctl_sk, &skb->dst, &fl)) {
- if (xfrm_lookup(net, &skb->dst, &fl, NULL, 0) >= 0) {
+ if (!ip6_dst_lookup(ctl_sk, &dst, &fl)) {
+ if (xfrm_lookup(net, &dst, &fl, NULL, 0) >= 0) {
+ skb_dst_set(skb, dst);
ip6_xmit(ctl_sk, skb, &fl, NULL, 0);
DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS);