summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-12-13 17:35:06 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-13 17:35:06 -0500
commitbb3c36863e8001fc21a88bebfdead4da4c23e848 (patch)
tree68d479f11721abaac0713792d096b98aa04b9854 /net
parent3f1e6d3fd37bd4f25e5b19f1c7ca21850426c33f (diff)
downloadlinux-3.10-bb3c36863e8001fc21a88bebfdead4da4c23e848.tar.gz
linux-3.10-bb3c36863e8001fc21a88bebfdead4da4c23e848.tar.bz2
linux-3.10-bb3c36863e8001fc21a88bebfdead4da4c23e848.zip
ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 3399dd32628..b582a0a0f1c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -728,7 +728,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);