Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 961323dd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "ipv6: set rt6i_protocol properly in the route when it is installed"



This reverts commit 23e983e2 which is
commit b91d532928dff2141ea9c107c3e73104d9843767 upstream.

It breaks the Android networking test suite, which works fine with the
backported patch in 4.14.  So something must be off for 4.9 for this
patch, so just revert it.

Cc: Jianlin Shi <jishi@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Xin Long <lucien.xin@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0afb423b
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -2292,7 +2292,6 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu
	if (on_link)
	if (on_link)
		nrt->rt6i_flags &= ~RTF_GATEWAY;
		nrt->rt6i_flags &= ~RTF_GATEWAY;


	nrt->rt6i_protocol = RTPROT_REDIRECT;
	nrt->rt6i_gateway = *(struct in6_addr *)neigh->primary_key;
	nrt->rt6i_gateway = *(struct in6_addr *)neigh->primary_key;


	if (ip6_ins_rt(nrt))
	if (ip6_ins_rt(nrt))
@@ -2397,7 +2396,6 @@ static struct rt6_info *rt6_add_route_info(struct net *net,
		.fc_dst_len	= prefixlen,
		.fc_dst_len	= prefixlen,
		.fc_flags	= RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO |
		.fc_flags	= RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO |
				  RTF_UP | RTF_PREF(pref),
				  RTF_UP | RTF_PREF(pref),
		.fc_protocol = RTPROT_RA,
		.fc_nlinfo.portid = 0,
		.fc_nlinfo.portid = 0,
		.fc_nlinfo.nlh = NULL,
		.fc_nlinfo.nlh = NULL,
		.fc_nlinfo.nl_net = net,
		.fc_nlinfo.nl_net = net,
@@ -2450,7 +2448,6 @@ struct rt6_info *rt6_add_dflt_router(const struct in6_addr *gwaddr,
		.fc_ifindex	= dev->ifindex,
		.fc_ifindex	= dev->ifindex,
		.fc_flags	= RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT |
		.fc_flags	= RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT |
				  RTF_UP | RTF_EXPIRES | RTF_PREF(pref),
				  RTF_UP | RTF_EXPIRES | RTF_PREF(pref),
		.fc_protocol = RTPROT_RA,
		.fc_nlinfo.portid = 0,
		.fc_nlinfo.portid = 0,
		.fc_nlinfo.nlh = NULL,
		.fc_nlinfo.nlh = NULL,
		.fc_nlinfo.nl_net = dev_net(dev),
		.fc_nlinfo.nl_net = dev_net(dev),
@@ -3247,6 +3244,14 @@ static int rt6_fill_node(struct net *net,
	}
	}
	rtm->rtm_scope = RT_SCOPE_UNIVERSE;
	rtm->rtm_scope = RT_SCOPE_UNIVERSE;
	rtm->rtm_protocol = rt->rt6i_protocol;
	rtm->rtm_protocol = rt->rt6i_protocol;
	if (rt->rt6i_flags & RTF_DYNAMIC)
		rtm->rtm_protocol = RTPROT_REDIRECT;
	else if (rt->rt6i_flags & RTF_ADDRCONF) {
		if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ROUTEINFO))
			rtm->rtm_protocol = RTPROT_RA;
		else
			rtm->rtm_protocol = RTPROT_KERNEL;
	}


	if (rt->rt6i_flags & RTF_CACHE)
	if (rt->rt6i_flags & RTF_CACHE)
		rtm->rtm_flags |= RTM_F_CLONED;
		rtm->rtm_flags |= RTM_F_CLONED;