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/mcast.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/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 4b48819a5b8d..4b264ed40a8c 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1448,6 +1448,7 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1448 | struct net *net = dev_net(skb->dev); | 1448 | struct net *net = dev_net(skb->dev); |
1449 | int err; | 1449 | int err; |
1450 | struct flowi fl; | 1450 | struct flowi fl; |
1451 | struct dst_entry *dst; | ||
1451 | 1452 | ||
1452 | IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); | 1453 | IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); |
1453 | 1454 | ||
@@ -1459,9 +1460,9 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1459 | IPPROTO_ICMPV6, csum_partial(skb_transport_header(skb), | 1460 | IPPROTO_ICMPV6, csum_partial(skb_transport_header(skb), |
1460 | mldlen, 0)); | 1461 | mldlen, 0)); |
1461 | 1462 | ||
1462 | skb->dst = icmp6_dst_alloc(skb->dev, NULL, &ipv6_hdr(skb)->daddr); | 1463 | dst = icmp6_dst_alloc(skb->dev, NULL, &ipv6_hdr(skb)->daddr); |
1463 | 1464 | ||
1464 | if (!skb->dst) { | 1465 | if (!dst) { |
1465 | err = -ENOMEM; | 1466 | err = -ENOMEM; |
1466 | goto err_out; | 1467 | goto err_out; |
1467 | } | 1468 | } |
@@ -1470,7 +1471,8 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1470 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, | 1471 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
1471 | skb->dev->ifindex); | 1472 | skb->dev->ifindex); |
1472 | 1473 | ||
1473 | err = xfrm_lookup(net, &skb->dst, &fl, NULL, 0); | 1474 | err = xfrm_lookup(net, &dst, &fl, NULL, 0); |
1475 | skb_dst_set(skb, dst); | ||
1474 | if (err) | 1476 | if (err) |
1475 | goto err_out; | 1477 | goto err_out; |
1476 | 1478 | ||
@@ -1775,6 +1777,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1775 | IPV6_TLV_ROUTERALERT, 2, 0, 0, | 1777 | IPV6_TLV_ROUTERALERT, 2, 0, 0, |
1776 | IPV6_TLV_PADN, 0 }; | 1778 | IPV6_TLV_PADN, 0 }; |
1777 | struct flowi fl; | 1779 | struct flowi fl; |
1780 | struct dst_entry *dst; | ||
1778 | 1781 | ||
1779 | if (type == ICMPV6_MGM_REDUCTION) | 1782 | if (type == ICMPV6_MGM_REDUCTION) |
1780 | snd_addr = &in6addr_linklocal_allrouters; | 1783 | snd_addr = &in6addr_linklocal_allrouters; |
@@ -1828,8 +1831,8 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1828 | 1831 | ||
1829 | idev = in6_dev_get(skb->dev); | 1832 | idev = in6_dev_get(skb->dev); |
1830 | 1833 | ||
1831 | skb->dst = icmp6_dst_alloc(skb->dev, NULL, &ipv6_hdr(skb)->daddr); | 1834 | dst = icmp6_dst_alloc(skb->dev, NULL, &ipv6_hdr(skb)->daddr); |
1832 | if (!skb->dst) { | 1835 | if (!dst) { |
1833 | err = -ENOMEM; | 1836 | err = -ENOMEM; |
1834 | goto err_out; | 1837 | goto err_out; |
1835 | } | 1838 | } |
@@ -1838,11 +1841,11 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1838 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, | 1841 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
1839 | skb->dev->ifindex); | 1842 | skb->dev->ifindex); |
1840 | 1843 | ||
1841 | err = xfrm_lookup(net, &skb->dst, &fl, NULL, 0); | 1844 | err = xfrm_lookup(net, &dst, &fl, NULL, 0); |
1842 | if (err) | 1845 | if (err) |
1843 | goto err_out; | 1846 | goto err_out; |
1844 | 1847 | ||
1845 | 1848 | skb_dst_set(skb, dst); | |
1846 | err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, skb->dev, | 1849 | err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, skb->dev, |
1847 | dst_output); | 1850 | dst_output); |
1848 | out: | 1851 | out: |