ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
authorDavid S. Miller <davem@davemloft.net>
Tue, 13 Dec 2011 22:35:06 +0000 (17:35 -0500)
committerRohan Somvanshi <rsomvanshi@nvidia.com>
Wed, 11 Jan 2012 18:31:31 +0000 (10:31 -0800)
commit8192849c42716b15a8ee8ebececf4e7c585ca5c7
tree23db606237e5c8290d88fba57a05193665beff06
parent0f98ee27faf8a6ec88bac804b19e79854ea0e0b8
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>
net/ipv6/route.c