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/ipv6/tcp_ipv6.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/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index ea37741062a9..53b6a4192b16 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -981,9 +981,10 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
981 | struct tcphdr *th = tcp_hdr(skb), *t1; | 981 | struct tcphdr *th = tcp_hdr(skb), *t1; |
982 | struct sk_buff *buff; | 982 | struct sk_buff *buff; |
983 | struct flowi fl; | 983 | struct flowi fl; |
984 | struct net *net = dev_net(skb->dst->dev); | 984 | struct net *net = dev_net(skb_dst(skb)->dev); |
985 | struct sock *ctl_sk = net->ipv6.tcp_sk; | 985 | struct sock *ctl_sk = net->ipv6.tcp_sk; |
986 | unsigned int tot_len = sizeof(struct tcphdr); | 986 | unsigned int tot_len = sizeof(struct tcphdr); |
987 | struct dst_entry *dst; | ||
987 | __be32 *topt; | 988 | __be32 *topt; |
988 | 989 | ||
989 | if (ts) | 990 | if (ts) |
@@ -1052,8 +1053,9 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
1052 | * Underlying function will use this to retrieve the network | 1053 | * Underlying function will use this to retrieve the network |
1053 | * namespace | 1054 | * namespace |
1054 | */ | 1055 | */ |
1055 | if (!ip6_dst_lookup(ctl_sk, &buff->dst, &fl)) { | 1056 | if (!ip6_dst_lookup(ctl_sk, &dst, &fl)) { |
1056 | if (xfrm_lookup(net, &buff->dst, &fl, NULL, 0) >= 0) { | 1057 | if (xfrm_lookup(net, &dst, &fl, NULL, 0) >= 0) { |
1058 | skb_dst_set(buff, dst); | ||
1057 | ip6_xmit(ctl_sk, buff, &fl, NULL, 0); | 1059 | ip6_xmit(ctl_sk, buff, &fl, NULL, 0); |
1058 | TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS); | 1060 | TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS); |
1059 | if (rst) | 1061 | if (rst) |