ipv6: drop the judgement in rt6_alloc_cow()
Now rt6_alloc_cow() is only called by ip6_pol_route() when rt->rt6i_flags doesn't contain both RTF_NONEXTHOP and RTF_GATEWAY, and rt->rt6i_flags hasn't been changed in ip6_rt_copy(). So there is no neccessary to judge whether rt->rt6i_flags contains RTF_GATEWAY or not. Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0e033e04c2
commit
249a3630c4
|
@ -871,11 +871,9 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort,
|
||||||
rt = ip6_rt_copy(ort, daddr);
|
rt = ip6_rt_copy(ort, daddr);
|
||||||
|
|
||||||
if (rt) {
|
if (rt) {
|
||||||
if (!(rt->rt6i_flags & RTF_GATEWAY)) {
|
if (ort->rt6i_dst.plen != 128 &&
|
||||||
if (ort->rt6i_dst.plen != 128 &&
|
ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
|
||||||
ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
|
rt->rt6i_flags |= RTF_ANYCAST;
|
||||||
rt->rt6i_flags |= RTF_ANYCAST;
|
|
||||||
}
|
|
||||||
|
|
||||||
rt->rt6i_flags |= RTF_CACHE;
|
rt->rt6i_flags |= RTF_CACHE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue