All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
Date: Wed, 14 Dec 2011 08:16:02 +0800	[thread overview]
Message-ID: <4EE7EAC2.2030600@intel.com> (raw)
In-Reply-To: <20111213.173551.163815101446083653.davem@davemloft.net>

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

      reply	other threads:[~2011-12-14  0:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE7EAC2.2030600@intel.com \
    --to=zheng.z.yan@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.