diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-13 17:35:06 -0500 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-01-11 10:31:31 -0800 |
commit | 8192849c42716b15a8ee8ebececf4e7c585ca5c7 (patch) | |
tree | 23db606237e5c8290d88fba57a05193665beff06 /net | |
parent | 0f98ee27faf8a6ec88bac804b19e79854ea0e0b8 (diff) |
ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
[ Upstream commit bb3c36863e8001fc21a88bebfdead4da4c23e848 ]
After commit 8e2ec639173f325977818c45011ee176ef2b11f6 ("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>
Change-Id: Iea67f1fb5976ad72d27e45dff42017894f30b563
Reviewed-on: http://git-master/r/74223
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/route.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 57b82dc1ae91..f02fe523bd3a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -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); |