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 /drivers/net/pppol2tp.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 'drivers/net/pppol2tp.c')
-rw-r--r-- | drivers/net/pppol2tp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index 5981debcde5e..e7935d09c896 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c | |||
@@ -433,8 +433,7 @@ static void pppol2tp_recv_dequeue_skb(struct pppol2tp_session *session, struct s | |||
433 | * to the inner packet either | 433 | * to the inner packet either |
434 | */ | 434 | */ |
435 | secpath_reset(skb); | 435 | secpath_reset(skb); |
436 | dst_release(skb->dst); | 436 | skb_dst_drop(skb); |
437 | skb->dst = NULL; | ||
438 | nf_reset(skb); | 437 | nf_reset(skb); |
439 | 438 | ||
440 | po = pppox_sk(session_sock); | 439 | po = pppox_sk(session_sock); |
@@ -976,7 +975,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh | |||
976 | /* Calculate UDP checksum if configured to do so */ | 975 | /* Calculate UDP checksum if configured to do so */ |
977 | if (sk_tun->sk_no_check == UDP_CSUM_NOXMIT) | 976 | if (sk_tun->sk_no_check == UDP_CSUM_NOXMIT) |
978 | skb->ip_summed = CHECKSUM_NONE; | 977 | skb->ip_summed = CHECKSUM_NONE; |
979 | else if (!(skb->dst->dev->features & NETIF_F_V4_CSUM)) { | 978 | else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) { |
980 | skb->ip_summed = CHECKSUM_COMPLETE; | 979 | skb->ip_summed = CHECKSUM_COMPLETE; |
981 | csum = skb_checksum(skb, 0, udp_len, 0); | 980 | csum = skb_checksum(skb, 0, udp_len, 0); |
982 | uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr, | 981 | uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr, |
@@ -1172,14 +1171,14 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
1172 | nf_reset(skb); | 1171 | nf_reset(skb); |
1173 | 1172 | ||
1174 | /* Get routing info from the tunnel socket */ | 1173 | /* Get routing info from the tunnel socket */ |
1175 | dst_release(skb->dst); | 1174 | skb_dst_drop(skb); |
1176 | skb->dst = dst_clone(__sk_dst_get(sk_tun)); | 1175 | skb_dst_set(skb, dst_clone(__sk_dst_get(sk_tun))); |
1177 | pppol2tp_skb_set_owner_w(skb, sk_tun); | 1176 | pppol2tp_skb_set_owner_w(skb, sk_tun); |
1178 | 1177 | ||
1179 | /* Calculate UDP checksum if configured to do so */ | 1178 | /* Calculate UDP checksum if configured to do so */ |
1180 | if (sk_tun->sk_no_check == UDP_CSUM_NOXMIT) | 1179 | if (sk_tun->sk_no_check == UDP_CSUM_NOXMIT) |
1181 | skb->ip_summed = CHECKSUM_NONE; | 1180 | skb->ip_summed = CHECKSUM_NONE; |
1182 | else if (!(skb->dst->dev->features & NETIF_F_V4_CSUM)) { | 1181 | else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) { |
1183 | skb->ip_summed = CHECKSUM_COMPLETE; | 1182 | skb->ip_summed = CHECKSUM_COMPLETE; |
1184 | csum = skb_checksum(skb, 0, udp_len, 0); | 1183 | csum = skb_checksum(skb, 0, udp_len, 0); |
1185 | uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr, | 1184 | uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr, |