* [PATCH] ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
@ 2011-12-13 22:35 David Miller
2011-12-14 0:16 ` Yan, Zheng
0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2011-12-13 22:35 UTC (permalink / raw)
To: netdev; +Cc: zheng.z.yan
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>
---
Committed to 'net'.
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 3399dd3..b582a0a 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);
--
1.7.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
2011-12-13 22:35 [PATCH] ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow() David Miller
@ 2011-12-14 0:16 ` Yan, Zheng
0 siblings, 0 replies; 2+ messages in thread
From: Yan, Zheng @ 2011-12-14 0:16 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On 12/14/2011 06:35 AM, David Miller wrote:
>
> 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>
> ---
>
> Committed to 'net'.
>
> 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 3399dd3..b582a0a 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);
My fault, sorry!
Yan, Zheng
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-14 0:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 22:35 [PATCH] ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow() David Miller
2011-12-14 0:16 ` Yan, Zheng
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.