From: Heiner Kallweit <heiner.kallweit@web.de>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] ipv6: If a public address is deleted then also delete all temporary addresses still referring to it
Date: Thu, 20 Mar 2014 00:40:39 +0100 [thread overview]
Message-ID: <532A2AF7.7040100@web.de> (raw)
In-Reply-To: <20140319224121.GI12291@order.stressinduktion.org>
Am 19.03.2014 23:41, schrieb Hannes Frederic Sowa:
> On Wed, Mar 19, 2014 at 10:17:32PM +0100, Heiner Kallweit wrote:
>> Am 19.03.2014 21:21, schrieb Hannes Frederic Sowa:
>>> On Tue, Mar 18, 2014 at 09:46:40PM +0100, Heiner Kallweit wrote:
>>>> If a public address is deleted by an external trigger (e.g. via inet6_rtm_deladdr) then temporary
>>>> addresses still referring to it may remain. Happened here when the WiFi link broke and netifd
>>>> deleted the public address. Once the link was back and prefix_rcv created new public addresses
>>>> ipv6_create_tempaddr complained that the temporary address already existed.
>>> Which error was it specifically?
>>>
>>>> IMHO no temporary address should live longer than its parent, especially because ifpub of the
>>>> temporary address still points to the then deleted public address otherwise.
>>> Reference counting will take care of that.
>>>
>>>> Therefore delete all related temporary addresses before a public address is deleted in inet6_addr_del
>>>> which is called by inet6_rtm_del.
>>> I am a bit concerend with backward compatibility here.
>>>
>>>> Also ensure in ipv6_del_addr that no temporary address lives longer than its parent.
>>> I currently don't see a problem with that.
>>>
>>> Greetings,
>>>
>>> Hannes
>>>
>>>
>> The specific error was "retry temporary address regeneration" caused by ipv6_add_addr returning EEXIST.
>>
>> First question is whether it's correct that in case of link loss the public address is deleted but not the temporary addresses.
>> I don't think it's correct.
> The kernel doesn't delete any addresses in case of link loss. netifd must
> have done so. In this case netifd should have flushed all addresses from
> the prefix.
>
> Sure, this is racy and the error therefore looks justified for me.
>
>> If it's not correct then the question is who's reponsibility it is to delete temporary addresses if the parent public address is deleted.
> In my opinion those addresses are simple standalone addresses. The link
> to the public addresses is just for management purposes and should be
> hidden from user space.
>
> So I would be ok, if we enhance the error case a bit, maybe reparent the
> old temporary address, drop them and silently generate them anew or only
> update prefix information from the new received prefix information. This
> should happen without disturbing TCP connections etc. I think this
> already works, but I don't know if it is worth the effort.
>
>> My solution was to do it in the kernel but this might not be the best / correct approach.
>> Would you prefer that userspace / netifd take care to also delete the temporary addresses?
> Yes, I would prefer that.
>
>> Last but not least the question is whether the kernel should care in general about the situation that a public address is deleted and orphaned
>> temporary addresses are left behind.
> I think that we should think of temporary addresses as stand-alone
> (IFA_F_MANAGETEMPADDR is a different story).
>
> Btw. there was already lots of discussions whether automatically drop addresses
> of an interface in case of link-loss, you can read the IMHO most relevant here:
> <http://markmail.org/thread/wcb6f6lcuyfuli7b>
>
> Greetings,
>
> Hannes
>
>
Thanks for the link, Hannes. Interesting read .. The discussion somehow stopped in the middle but they also tended to handle such issues in user space.
Will think about it again, check the netifd sources and maybe follow-up on this with the OpenWRT guys.
Rgds, Heiner
next prev parent reply other threads:[~2014-03-19 23:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 20:46 [PATCH net] ipv6: If a public address is deleted then also delete all temporary addresses still referring to it Heiner Kallweit
2014-03-19 20:21 ` Hannes Frederic Sowa
2014-03-19 21:17 ` Heiner Kallweit
2014-03-19 22:41 ` Hannes Frederic Sowa
2014-03-19 23:40 ` Heiner Kallweit [this message]
2014-03-26 20:27 ` Heiner Kallweit
2014-03-26 21:50 ` Heiner Kallweit
2014-03-27 2:53 ` Hannes Frederic Sowa
2014-04-06 18:56 ` Heiner Kallweit
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=532A2AF7.7040100@web.de \
--to=heiner.kallweit@web.de \
--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).