diff options
Diffstat (limited to 'net/ipv6/route.c')
| -rw-r--r-- | net/ipv6/route.c | 37 | 
1 files changed, 20 insertions, 17 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index fd059e08785a..a63ff85fe141 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -227,7 +227,7 @@ static void ip6_confirm_neigh(const struct dst_entry *dst, const void *daddr)  	struct net_device *dev = dst->dev;  	struct rt6_info *rt = (struct rt6_info *)dst; -	daddr = choose_neigh_daddr(&rt->rt6i_gateway, NULL, daddr); +	daddr = choose_neigh_daddr(rt6_nexthop(rt, &in6addr_any), NULL, daddr);  	if (!daddr)  		return;  	if (dev->flags & (IFF_NOARP | IFF_LOOPBACK)) @@ -2725,10 +2725,9 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,  		rcu_read_lock();  		res.f6i = rcu_dereference(rt6->from); -		if (!res.f6i) { -			rcu_read_unlock(); -			return; -		} +		if (!res.f6i) +			goto out_unlock; +  		res.fib6_flags = res.f6i->fib6_flags;  		res.fib6_type = res.f6i->fib6_type; @@ -2744,10 +2743,8 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,  			/* fib6_info uses a nexthop that does not have fib6_nh  			 * using the dst->dev + gw. Should be impossible.  			 */ -			if (!arg.match) { -				rcu_read_unlock(); -				return; -			} +			if (!arg.match) +				goto out_unlock;  			res.nh = arg.match;  		} else { @@ -2760,6 +2757,7 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,  			if (rt6_insert_exception(nrt6, &res))  				dst_release_immediate(&nrt6->dst);  		} +out_unlock:  		rcu_read_unlock();  	}  } @@ -4388,13 +4386,14 @@ struct fib6_info *addrconf_f6i_alloc(struct net *net,  	struct fib6_config cfg = {  		.fc_table = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL,  		.fc_ifindex = idev->dev->ifindex, -		.fc_flags = RTF_UP | RTF_ADDRCONF | RTF_NONEXTHOP, +		.fc_flags = RTF_UP | RTF_NONEXTHOP,  		.fc_dst = *addr,  		.fc_dst_len = 128,  		.fc_protocol = RTPROT_KERNEL,  		.fc_nlinfo.nl_net = net,  		.fc_ignore_dev_down = true,  	}; +	struct fib6_info *f6i;  	if (anycast) {  		cfg.fc_type = RTN_ANYCAST; @@ -4404,7 +4403,10 @@ struct fib6_info *addrconf_f6i_alloc(struct net *net,  		cfg.fc_flags |= RTF_LOCAL;  	} -	return ip6_route_info_create(&cfg, gfp_flags, NULL); +	f6i = ip6_route_info_create(&cfg, gfp_flags, NULL); +	if (!IS_ERR(f6i)) +		f6i->dst_nocount = true; +	return f6i;  }  /* remove deleted ip from prefsrc entries */ @@ -5325,11 +5327,11 @@ static int rt6_fill_node_nexthop(struct sk_buff *skb, struct nexthop *nh,  	if (nexthop_is_multipath(nh)) {  		struct nlattr *mp; -		mp = nla_nest_start(skb, RTA_MULTIPATH); +		mp = nla_nest_start_noflag(skb, RTA_MULTIPATH);  		if (!mp)  			goto nla_put_failure; -		if (nexthop_mpath_fill_node(skb, nh)) +		if (nexthop_mpath_fill_node(skb, nh, AF_INET6))  			goto nla_put_failure;  		nla_nest_end(skb, mp); @@ -5337,7 +5339,7 @@ static int rt6_fill_node_nexthop(struct sk_buff *skb, struct nexthop *nh,  		struct fib6_nh *fib6_nh;  		fib6_nh = nexthop_fib6_nh(nh); -		if (fib_nexthop_info(skb, &fib6_nh->nh_common, +		if (fib_nexthop_info(skb, &fib6_nh->nh_common, AF_INET6,  				     flags, false) < 0)  			goto nla_put_failure;  	} @@ -5466,13 +5468,14 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,  			goto nla_put_failure;  		if (fib_add_nexthop(skb, &rt->fib6_nh->nh_common, -				    rt->fib6_nh->fib_nh_weight) < 0) +				    rt->fib6_nh->fib_nh_weight, AF_INET6) < 0)  			goto nla_put_failure;  		list_for_each_entry_safe(sibling, next_sibling,  					 &rt->fib6_siblings, fib6_siblings) {  			if (fib_add_nexthop(skb, &sibling->fib6_nh->nh_common, -					    sibling->fib6_nh->fib_nh_weight) < 0) +					    sibling->fib6_nh->fib_nh_weight, +					    AF_INET6) < 0)  				goto nla_put_failure;  		} @@ -5489,7 +5492,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,  		rtm->rtm_flags |= nh_flags;  	} else { -		if (fib_nexthop_info(skb, &rt->fib6_nh->nh_common, +		if (fib_nexthop_info(skb, &rt->fib6_nh->nh_common, AF_INET6,  				     &nh_flags, false) < 0)  			goto nla_put_failure;  |