mirror of
https://github.com/hardkernel/linux.git
synced 2026-05-31 08:16:39 +09:00
ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
[ Upstream commitbb3c36863e] After commit8e2ec63917("ipv6: don't use inetpeer to store metrics for routes.") the test in rt6_alloc_cow() for setting the ANYCAST flag is now wrong. 'rt' will always now have a plen of 128, because it is set explicitly to 128 by ip6_rt_copy. So to restore the semantics of the test, check the destination prefix length of 'ort'. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4e1a937bf1
commit
ea67f1fb59
@@ -725,7 +725,7 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort,
|
||||
int attempts = !in_softirq();
|
||||
|
||||
if (!(rt->rt6i_flags&RTF_GATEWAY)) {
|
||||
if (rt->rt6i_dst.plen != 128 &&
|
||||
if (ort->rt6i_dst.plen != 128 &&
|
||||
ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
|
||||
rt->rt6i_flags |= RTF_ANYCAST;
|
||||
ipv6_addr_copy(&rt->rt6i_gateway, daddr);
|
||||
|
||||
Reference in New Issue
Block a user