netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, hannes@stressinduktion.org
Subject: Re: [PATCH] net: ipv6: Make address flushing on ifdown optional
Date: Wed, 17 Feb 2016 11:09:29 -0700	[thread overview]
Message-ID: <56C4B759.70504@cumulusnetworks.com> (raw)
In-Reply-To: <20160217.130504.1799252766739262191.davem@davemloft.net>

On 2/17/16 11:05 AM, David Miller wrote:
> From: David Ahern <dsa@cumulusnetworks.com>
> Date: Sat, 13 Feb 2016 14:23:27 -0800
>
>> @@ -3427,31 +3493,52 @@ static int addrconf_ifdown(struct net_device *dev, int how)
>>   		write_lock_bh(&idev->lock);
>>   	}
>>
>> -	while (!list_empty(&idev->addr_list)) {
>> -		ifa = list_first_entry(&idev->addr_list,
>> -				       struct inet6_ifaddr, if_list);
>> -		addrconf_del_dad_work(ifa);
>> +	INIT_LIST_HEAD(&del_list);
>> +	list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list) {
>> +		bool keep_ifa = false;
>>
>> -		list_del(&ifa->if_list);
>> +		if (!how && keep_addr && ifa->user_managed)
>> +			keep_ifa = true;
>
> I think it would make sense to evaluate "!how && keep_addr" outside the
> loop.  The only thing that changes is ifa->user_managed on each iteration.
>
> But I also want some more documentation in what you are doing here.
>
> I understand the address flushing on ifdown avoidance, but all of this
> user_managed logic is not mentioned at all.  Why do you need it?  What
> role does it play in achieving your goal?
>

Per prior comment user_managed will go away in favor of checking 
IFA_F_PERMANENT. We are only keeping permanent addresses which in past 
versions of the patch were marked with user_managed flag but it is 
redundant.

      reply	other threads:[~2016-02-17 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-13 22:23 [PATCH] net: ipv6: Make address flushing on ifdown optional David Ahern
2016-02-13 22:25 ` David Ahern
2016-02-16  8:45 ` YOSHIFUJI Hideaki
2016-02-16 15:16   ` David Ahern
2016-02-17  2:10     ` YOSHIFUJI Hideaki
2016-02-17  3:45       ` David Ahern
2016-02-17 18:05 ` David Miller
2016-02-17 18:09   ` David Ahern [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=56C4B759.70504@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --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;
as well as URLs for NNTP newsgroup(s).