diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-06 17:04:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-06 17:04:13 -0500 |
commit | 87a115783eca7a424eef599d6f10a499f85f59c8 (patch) | |
tree | 4b80b4d2ea9a61253f89570f63da1ab9a356dfa4 /net/ipv6/mcast.c | |
parent | 8f0315190dec88bf035d50e4fd1db89859b414f6 (diff) |
ipv6: Move xfrm_lookup() call down into icmp6_dst_alloc().
And return error pointers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 518cbb90c44b..ea34d58e836d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1410,18 +1410,11 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1410 | csum_partial(skb_transport_header(skb), | 1410 | csum_partial(skb_transport_header(skb), |
1411 | mldlen, 0)); | 1411 | mldlen, 0)); |
1412 | 1412 | ||
1413 | dst = icmp6_dst_alloc(skb->dev, NULL, &ipv6_hdr(skb)->daddr); | ||
1414 | |||
1415 | if (!dst) { | ||
1416 | err = -ENOMEM; | ||
1417 | goto err_out; | ||
1418 | } | ||
1419 | |||
1420 | icmpv6_flow_init(net->ipv6.igmp_sk, &fl6, ICMPV6_MLD2_REPORT, | 1413 | icmpv6_flow_init(net->ipv6.igmp_sk, &fl6, ICMPV6_MLD2_REPORT, |
1421 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, | 1414 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
1422 | skb->dev->ifindex); | 1415 | skb->dev->ifindex); |
1416 | dst = icmp6_dst_alloc(skb->dev, NULL, &fl6); | ||
1423 | 1417 | ||
1424 | dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0); | ||
1425 | err = 0; | 1418 | err = 0; |
1426 | if (IS_ERR(dst)) { | 1419 | if (IS_ERR(dst)) { |
1427 | err = PTR_ERR(dst); | 1420 | err = PTR_ERR(dst); |
@@ -1785,17 +1778,10 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1785 | rcu_read_lock(); | 1778 | rcu_read_lock(); |
1786 | idev = __in6_dev_get(skb->dev); | 1779 | idev = __in6_dev_get(skb->dev); |
1787 | 1780 | ||
1788 | dst = icmp6_dst_alloc(skb->dev, NULL, &ipv6_hdr(skb)->daddr); | ||
1789 | if (!dst) { | ||
1790 | err = -ENOMEM; | ||
1791 | goto err_out; | ||
1792 | } | ||
1793 | |||
1794 | icmpv6_flow_init(sk, &fl6, type, | 1781 | icmpv6_flow_init(sk, &fl6, type, |
1795 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, | 1782 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
1796 | skb->dev->ifindex); | 1783 | skb->dev->ifindex); |
1797 | 1784 | dst = icmp6_dst_alloc(skb->dev, NULL, &fl6); | |
1798 | dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0); | ||
1799 | if (IS_ERR(dst)) { | 1785 | if (IS_ERR(dst)) { |
1800 | err = PTR_ERR(dst); | 1786 | err = PTR_ERR(dst); |
1801 | goto err_out; | 1787 | goto err_out; |