All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
To: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>,
	netdev@vger.kernel.org
Cc: hannes@stressinduktion.org
Subject: Re: [PATCH] net: ipv6: Make address flushing on ifdown optional
Date: Tue, 16 Feb 2016 08:16:47 -0700	[thread overview]
Message-ID: <56C33D5F.2060005@cumulusnetworks.com> (raw)
In-Reply-To: <56C2E1BD.30006@miraclelinux.com>

On 2/16/16 1:45 AM, YOSHIFUJI Hideaki wrote:
>> diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
>> index 24ce97f42d35..7ddbbb67f0db 100644
>> --- a/Documentation/networking/ip-sysctl.txt
>> +++ b/Documentation/networking/ip-sysctl.txt
>> @@ -1563,6 +1563,12 @@ temp_prefered_lft - INTEGER
>>   	Preferred lifetime (in seconds) for temporary addresses.
>>   	Default: 86400 (1 day)
>>   
>> +keep_addr_on_down - BOOLEAN
>> +	Keep all IPv6 addresses on an interface down event. If set static
>> +	global addresses with no expiration time are not flushed.
>> +
>> +	Default: disabled
>> +
> 
> How about this:
>     1: enabled
>     0: system default
>    -1: disabled
> so that an iterface can override system-wide config?

It is my understanding that the 'all' settings override the individual
interface settings. From Documentation/networking/ip-sysctl.txt +1346:

conf/all/*:
        Change all the interface-specific settings.


-----8<-----


>> diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
>> index 1c8b6820b694..01ba6a286a4b 100644
>> --- a/include/net/if_inet6.h
>> +++ b/include/net/if_inet6.h
>> @@ -72,6 +72,7 @@ struct inet6_ifaddr {
>>   	int			regen_count;
>>   
>>   	bool			tokenized;
>> +	bool			user_managed;
> 
> Can't we use IFA_F_PERMANENT?

I think so. Will fix.


-----8<-----

>> @@ -3356,7 +3413,9 @@ static int addrconf_ifdown(struct net_device *dev, int how)
>>   {
>>   	struct net *net = dev_net(dev);
>>   	struct inet6_dev *idev;
>> -	struct inet6_ifaddr *ifa;
>> +	struct inet6_ifaddr *ifa, *tmp;
>> +	struct list_head del_list;
>> +	int keep_addr;
>>   	int state, i;
>>   
>>   	ASSERT_RTNL();
>> @@ -3383,6 +3442,10 @@ static int addrconf_ifdown(struct net_device *dev, int how)
>>   
>>   	}
>>   
>> +	keep_addr = net->ipv6.devconf_all->keep_addr_on_down;
>> +	if (!keep_addr)
>> +		keep_addr = idev->cnf.keep_addr_on_down;
>> +
>>   	/* Step 2: clear hash table */
>>   	for (i = 0; i < IN6_ADDR_HSIZE; i++) {
>>   		struct hlist_head *h = &inet6_addr_lst[i];

So what I have here is if the system-wide setting says keep the address
it is kept. Else if the individual interface setting is enabled the
address is kept.

  reply	other threads:[~2016-02-16 15:17 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 [this message]
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

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=56C33D5F.2060005@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=hannes@stressinduktion.org \
    --cc=hideaki.yoshifuji@miraclelinux.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 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.