aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c16
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)
135 skb->len); 135 skb->len);
136 } 136 }
137 137
138 neigh = dst->neighbour; 138 neigh = dst_get_neighbour(dst);
139 if (neigh) 139 if (neigh)
140 return neigh_output(neigh, skb); 140 return neigh_output(neigh, skb);
141 141
@@ -385,6 +385,7 @@ int ip6_forward(struct sk_buff *skb)
385 struct ipv6hdr *hdr = ipv6_hdr(skb); 385 struct ipv6hdr *hdr = ipv6_hdr(skb);
386 struct inet6_skb_parm *opt = IP6CB(skb); 386 struct inet6_skb_parm *opt = IP6CB(skb);
387 struct net *net = dev_net(dst->dev); 387 struct net *net = dev_net(dst->dev);
388 struct neighbour *n;
388 u32 mtu; 389 u32 mtu;
389 390
390 if (net->ipv6.devconf_all->forwarding == 0) 391 if (net->ipv6.devconf_all->forwarding == 0)
@@ -459,11 +460,10 @@ int ip6_forward(struct sk_buff *skb)
459 send redirects to source routed frames. 460 send redirects to source routed frames.
460 We don't send redirects to frames decapsulated from IPsec. 461 We don't send redirects to frames decapsulated from IPsec.
461 */ 462 */
462 if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0 && 463 n = dst_get_neighbour(dst);
463 !skb_sec_path(skb)) { 464 if (skb->dev == dst->dev && n && opt->srcrt == 0 && !skb_sec_path(skb)) {
464 struct in6_addr *target = NULL; 465 struct in6_addr *target = NULL;
465 struct rt6_info *rt; 466 struct rt6_info *rt;
466 struct neighbour *n = dst->neighbour;
467 467
468 /* 468 /*
469 * incoming and outgoing devices are the same 469 * incoming and outgoing devices are the same
@@ -920,8 +920,11 @@ out:
920static int ip6_dst_lookup_tail(struct sock *sk, 920static int ip6_dst_lookup_tail(struct sock *sk,
921 struct dst_entry **dst, struct flowi6 *fl6) 921 struct dst_entry **dst, struct flowi6 *fl6)
922{ 922{
923 int err;
924 struct net *net = sock_net(sk); 923 struct net *net = sock_net(sk);
924#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
925 struct neighbour *n;
926#endif
927 int err;
925 928
926 if (*dst == NULL) 929 if (*dst == NULL)
927 *dst = ip6_route_output(net, sk, fl6); 930 *dst = ip6_route_output(net, sk, fl6);
@@ -947,7 +950,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
947 * dst entry and replace it instead with the 950 * dst entry and replace it instead with the
948 * dst entry of the nexthop router 951 * dst entry of the nexthop router
949 */ 952 */
950 if ((*dst)->neighbour && !((*dst)->neighbour->nud_state & NUD_VALID)) { 953 n = dst_get_neighbour(*dst);
954 if (n && !(n->nud_state & NUD_VALID)) {
951 struct inet6_ifaddr *ifp; 955 struct inet6_ifaddr *ifp;
952 struct flowi6 fl_gw6; 956 struct flowi6 fl_gw6;
953 int redirect; 957 int redirect;