From: Stephen Hemminger <shemminger@vyatta.com>
To: Lorenzo Colitti <lorenzo@google.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Subject: Re: [PATCH] ipv6: slightly simplify keeping IPv6 addresses on link down
Date: Wed, 1 Dec 2010 13:04:21 -0800 [thread overview]
Message-ID: <20101201130421.0ac08bcd@nehalam> (raw)
In-Reply-To: <AANLkTin5f+BZnFEzuc6iPLC8Hp++V0Jam8aAU2jMvxQq@mail.gmail.com>
On Wed, 1 Dec 2010 12:52:42 -0800
Lorenzo Colitti <lorenzo@google.com> wrote:
> On Wed, Dec 1, 2010 at 12:22 PM, Stephen Hemminger
> <shemminger@vyatta.com> wrote:
> > > --- a/net/ipv6/addrconf.c
> > > +++ b/net/ipv6/addrconf.c
> > > @@ -2663,7 +2663,8 @@ static int addrconf_ifdown(struct net_device *dev, int how)
> > > {
> > > struct net *net = dev_net(dev);
> > > struct inet6_dev *idev;
> > > - struct inet6_ifaddr *ifa, *ifn;
> > > + struct inet6_ifaddr *ifa;
> > > + LIST_HEAD(keep_list);
> > > int state;
> >
> > Your patch is backwards? The existing code is:
>
> Oops, yes. Wrong order of arguments. Another one coming up.
>
> > Also, the addrconf_ifdown can race with other updates to idev->addr_list
> > from addrconf timers etc. Therefore even list_for_each_entry_safe is not safe.
>
> No, wait... The loop is protected by idev->lock, and the code just
> before it that clears the temporary address list is essentially
> identical (except it looks over tempaddr_list instead). Wouldn't that
> blow up as well?
The old code walked the list until it was empty. New code could
get confused if list changed by other changes during the
period when idev->lock is dropped and notifier is called.
--
next prev parent reply other threads:[~2010-12-01 21:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-26 18:06 [PATCH] ipv6: slightly simplify keeping IPv6 addresses on link down Lorenzo Colitti
2010-12-01 19:01 ` David Miller
2010-12-01 19:38 ` Lorenzo Colitti
2010-12-01 20:22 ` Stephen Hemminger
2010-12-01 20:52 ` Lorenzo Colitti
2010-12-01 21:04 ` Stephen Hemminger [this message]
2010-12-10 20:43 ` David Miller
2010-12-10 23:00 ` Lorenzo Colitti
2010-12-01 20:54 ` Lorenzo Colitti
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=20101201130421.0ac08bcd@nehalam \
--to=shemminger@vyatta.com \
--cc=davem@davemloft.net \
--cc=lorenzo@google.com \
--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