public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@redhat•com>
To: David Ahern <dsa@cumulusnetworks•com>, netdev@vger•kernel.org
Cc: nicolas.dichtel@6wind•com
Subject: Re: [PATCH net-next v4] net: ipv6: Make address flushing on ifdown optional
Date: Thu, 08 Oct 2015 21:47:25 +0200	[thread overview]
Message-ID: <877fmxcfci.fsf@stressinduktion.org> (raw)
In-Reply-To: <5616C5AE.8010707@cumulusnetworks.com>

Hi David,

David Ahern <dsa@cumulusnetworks•com> writes:
> On 10/8/15 1:25 PM, Hannes Frederic Sowa wrote:
>>> diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
>>> index 1c8b6820b694..f190a14148ab 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			managed;
>>
>> IMHO the naming of the bool is a bit too vague. ;) Would you mind
>> renaming it to something like puuh... user_managed, non_autoconf,
>> manual_conf etc.?  'managed' seems so often used in the context of
>> temporary addresses, I first thought about that.
>>
>> enum { USER_SPACE, KERNEL_AUTOCONF } managed_by;
>
> I have no preference on naming; unless other preferences are stated I'll 
> do v5 with it renamed to 'user_managed'.

I think this is more appropriate. Thanks!

>>> @@ -2689,6 +2692,9 @@ static int inet6_addr_add(struct net *net, int ifindex,
>>>   			    valid_lft, prefered_lft);
>>>
>>>   	if (!IS_ERR(ifp)) {
>>> +		if (!expires)
>>> +			ifp->managed = true;
>>> +
>>
>> This assumes that user space managed addresses don't time out. This is
>> in fact not true. I am not sure if it matters a lot, as most addresses
>> added from user space with a timeout most probably will be added because
>> of autoconf, but they are not managed by kernel autoconf. Not sure if we
>> want to make this more explicit, certainly it would avoid surprises.
>
> Not exactly. I'm taking the easy way out and saying only addresses with 
> no expiration time fall into the 'user managed' category and retained on 
> an ifdown. Trying to accommodate lifetimes is a PITA. I mentioned that 
> in the documentation:
>    "static global addresses with no expiration time are not flushed"

Hmm, I thought a call to addrconf_verify on up would be sufficient but
haven't looked into that too closely.

Anyway, this logic actually only makes sense with addresses which don't
expire.

Thanks,
Hannes

  reply	other threads:[~2015-10-08 19:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 15:17 [PATCH net-next v4] net: ipv6: Make address flushing on ifdown optional David Ahern
2015-10-07 15:43 ` Sowmini Varadhan
2015-10-07 17:01   ` David Ahern
2015-10-08 19:25 ` Hannes Frederic Sowa
2015-10-08 19:36   ` David Ahern
2015-10-08 19:47     ` Hannes Frederic Sowa [this message]
2015-10-11 11:44 ` 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=877fmxcfci.fsf@stressinduktion.org \
    --to=hannes@redhat$(echo .)com \
    --cc=dsa@cumulusnetworks$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nicolas.dichtel@6wind$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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