diff options
author | David S. Miller <davem@davemloft.net> | 2011-07-18 08:09:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-18 08:11:35 +0200 |
commit | 69cce1d1404968f78b177a0314f5822d5afdbbfb (patch) | |
tree | 26223264fd69ea8078d0013fd5a76eb7aeb04c12 /net/ipv6/ip6_output.c | |
parent | ipv6: Get rid of rt6i_nexthop macro. (diff) | |
download | linux-69cce1d1404968f78b177a0314f5822d5afdbbfb.tar.xz linux-69cce1d1404968f78b177a0314f5822d5afdbbfb.zip |
net: Abstract dst->neighbour accesses behind helpers.
dst_{get,set}_neighbour()
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index eb50bb07ab2e..8db0e4875ad8 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -135,7 +135,7 @@ static int ip6_finish_output2(struct sk_buff *skb) skb->len); } - neigh = dst->neighbour; + neigh = dst_get_neighbour(dst); if (neigh) return neigh_output(neigh, skb); @@ -385,6 +385,7 @@ int ip6_forward(struct sk_buff *skb) struct ipv6hdr *hdr = ipv6_hdr(skb); struct inet6_skb_parm *opt = IP6CB(skb); struct net *net = dev_net(dst->dev); + struct neighbour *n; u32 mtu; if (net->ipv6.devconf_all->forwarding == 0) @@ -459,11 +460,10 @@ int ip6_forward(struct sk_buff *skb) send redirects to source routed frames. We don't send redirects to frames decapsulated from IPsec. */ - if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0 && - !skb_sec_path(skb)) { + n = dst_get_neighbour(dst); + if (skb->dev == dst->dev && n && opt->srcrt == 0 && !skb_sec_path(skb)) { struct in6_addr *target = NULL; struct rt6_info *rt; - struct neighbour *n = dst->neighbour; /* * incoming and outgoing devices are the same @@ -920,8 +920,11 @@ out: static int ip6_dst_lookup_tail(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6) { - int err; struct net *net = sock_net(sk); +#ifdef CONFIG_IPV6_OPTIMISTIC_DAD + struct neighbour *n; +#endif + int err; if (*dst == NULL) *dst = ip6_route_output(net, sk, fl6); @@ -947,7 +950,8 @@ static int ip6_dst_lookup_tail(struct sock *sk, * dst entry and replace it instead with the * dst entry of the nexthop router */ - if ((*dst)->neighbour && !((*dst)->neighbour->nud_state & NUD_VALID)) { + n = dst_get_neighbour(*dst); + if (n && !(n->nud_state & NUD_VALID)) { struct inet6_ifaddr *ifp; struct flowi6 fl_gw6; int redirect; |