diff options
author | David S. Miller <davem@davemloft.net> | 2012-01-26 15:23:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-26 15:23:21 -0500 |
commit | 1e2927b08160a14fff98e88e7a331d916aaa1d56 (patch) | |
tree | 745e1793166c9f365262ec1f257d0fb5bfc0119b /net | |
parent | 39232973b779ab0c02cb6dcd8f819b7cb0fcd09a (diff) |
ipv6: sit: Convert to dst_neigh_lookup()
The only semantic difference is that we now hold a reference to the
neighbour and thus have to release it.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/sit.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 133768e52912..c4ffd1743528 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -680,9 +680,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
680 | /* ISATAP (RFC4214) - must come before 6to4 */ | 680 | /* ISATAP (RFC4214) - must come before 6to4 */ |
681 | if (dev->priv_flags & IFF_ISATAP) { | 681 | if (dev->priv_flags & IFF_ISATAP) { |
682 | struct neighbour *neigh = NULL; | 682 | struct neighbour *neigh = NULL; |
683 | bool do_tx_error = false; | ||
683 | 684 | ||
684 | if (skb_dst(skb)) | 685 | if (skb_dst(skb)) |
685 | neigh = dst_get_neighbour_noref(skb_dst(skb)); | 686 | neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr); |
686 | 687 | ||
687 | if (neigh == NULL) { | 688 | if (neigh == NULL) { |
688 | if (net_ratelimit()) | 689 | if (net_ratelimit()) |
@@ -697,6 +698,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
697 | ipv6_addr_is_isatap(addr6)) | 698 | ipv6_addr_is_isatap(addr6)) |
698 | dst = addr6->s6_addr32[3]; | 699 | dst = addr6->s6_addr32[3]; |
699 | else | 700 | else |
701 | do_tx_error = true; | ||
702 | |||
703 | neigh_release(neigh); | ||
704 | if (do_tx_error) | ||
700 | goto tx_error; | 705 | goto tx_error; |
701 | } | 706 | } |
702 | 707 | ||
@@ -705,9 +710,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
705 | 710 | ||
706 | if (!dst) { | 711 | if (!dst) { |
707 | struct neighbour *neigh = NULL; | 712 | struct neighbour *neigh = NULL; |
713 | bool do_tx_error = false; | ||
708 | 714 | ||
709 | if (skb_dst(skb)) | 715 | if (skb_dst(skb)) |
710 | neigh = dst_get_neighbour_noref(skb_dst(skb)); | 716 | neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr); |
711 | 717 | ||
712 | if (neigh == NULL) { | 718 | if (neigh == NULL) { |
713 | if (net_ratelimit()) | 719 | if (net_ratelimit()) |
@@ -723,10 +729,14 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
723 | addr_type = ipv6_addr_type(addr6); | 729 | addr_type = ipv6_addr_type(addr6); |
724 | } | 730 | } |
725 | 731 | ||
726 | if ((addr_type & IPV6_ADDR_COMPATv4) == 0) | 732 | if ((addr_type & IPV6_ADDR_COMPATv4) != 0) |
727 | goto tx_error_icmp; | 733 | dst = addr6->s6_addr32[3]; |
734 | else | ||
735 | do_tx_error = true; | ||
728 | 736 | ||
729 | dst = addr6->s6_addr32[3]; | 737 | neigh_release(neigh); |
738 | if (do_tx_error) | ||
739 | goto tx_error; | ||
730 | } | 740 | } |
731 | 741 | ||
732 | rt = ip_route_output_ports(dev_net(dev), &fl4, NULL, | 742 | rt = ip_route_output_ports(dev_net(dev), &fl4, NULL, |