Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [BUG] ipv6: all routes share same inetpeer
Date: Tue, 19 Jul 2011 20:57:50 +0200	[thread overview]
Message-ID: <1311101870.3113.6.camel@edumazet-laptop> (raw)
In-Reply-To: <1311099638.3113.2.camel@edumazet-laptop>

Le mardi 19 juillet 2011 à 20:20 +0200, Eric Dumazet a écrit :
> Le mardi 19 juillet 2011 à 10:37 -0700, David Miller a écrit :
> > From: Eric Dumazet <eric.dumazet@gmail.com>
> > Date: Tue, 19 Jul 2011 19:23:49 +0200
> > 
> > > Maybe you can find the bug before me ?
> > 
> > I think when we add the route we cow the metrics almost immediately.
> > The daddr is, unfortunately, fully prefixed at that point.
> 
> Yes, we shall provide a second ip6_rt_copy() argument, with the
> destination address.
> 

Hmm, or maybe just change the dst_copy_metrics(&rt->dst, &ort->dst);
call done from ip6_rt_copy(), to avoid doing the COW if not really
needed ?

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index ddef80f..5403cea 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1740,7 +1740,7 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
 		rt->dst.input = ort->dst.input;
 		rt->dst.output = ort->dst.output;
 
-		dst_copy_metrics(&rt->dst, &ort->dst);
+		rt->dst._metrics = ort->dst._metrics;
 		rt->dst.error = ort->dst.error;
 		rt->rt6i_idev = ort->rt6i_idev;
 		if (rt->rt6i_idev)




  reply	other threads:[~2011-07-19 18:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 17:23 [BUG] ipv6: all routes share same inetpeer Eric Dumazet
2011-07-19 17:37 ` David Miller
2011-07-19 18:20   ` Eric Dumazet
2011-07-19 18:57     ` Eric Dumazet [this message]
2011-07-19 18:59       ` David Miller
2011-07-20  5:29         ` Eric Dumazet
2011-07-20  6:18           ` Eric Dumazet
2011-07-22  4:25             ` David Miller
2011-07-22  0:18           ` David Miller

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=1311101870.3113.6.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox