From: Heiner Kallweit <heiner.kallweit@web.de>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
"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: Sun, 06 Apr 2014 20:56:08 +0200 [thread overview]
Message-ID: <5341A348.7010808@web.de> (raw)
In-Reply-To: <20140327025303.GJ22086@order.stressinduktion.org>
Am 27.03.2014 03:53, schrieb Hannes Frederic Sowa:
> On Wed, Mar 26, 2014 at 10:50:06PM +0100, Heiner Kallweit wrote:
>>> I spent some thoughts on this topic and it seems to me that deleting a temporary address from user space will break TCP connections most of the time
>>> as the newly created temporary address will be different from the old one.
> Yes, I can confirm that we will generate new rndid and thus will generate a
> new address.
>
>>> Setting a temporary address to deprecated is also not possible from user space currently as netlink RTM_NEWADDR doesn't allow to modify the IFA_F_DEPRECATED flag:
>>>
>>> /* We ignore other flags so far. */
>>> ifa_flags &= IFA_F_NODAD | IFA_F_HOMEADDRESS | IFA_F_MANAGETEMPADDR |
>>> IFA_F_NOPREFIXROUTE;
>>>
>>> Having said that your suggestion seems to be the most appropriate way to tackle the issue:
>>>
>>> "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."
>>>
>>> The following patch works fine for me, I'd appreciate if you could have a look at it.
>>>
>>> Rgds, Heiner
>>>
>>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>>> index 344e972..7cc3dae 100644
>>> --- a/net/ipv6/addrconf.c
>>> +++ b/net/ipv6/addrconf.c
>>> @@ -2063,8 +2063,23 @@ static void manage_tempaddrs(struct inet6_dev *idev,
>>> list_for_each_entry(ift, &idev->tempaddr_list, tmp_list) {
>>> int age, max_valid, max_prefered;
>>>
>>> - if (ifp != ift->ifpub)
>>> - continue;
>>> + spin_lock(&ift->lock);
>>> + if (ifp != ift->ifpub) {
>>> + /* reparent if orphaned temporary addresses with same prefix is found */
>>> + if(ift->prefix_len == ifp->prefix_len && ipv6_prefix_equal(&ift->addr,&ifp->addr,ift->prefix_len)) {
>>> + in6_ifa_hold(ifp);
>>> + in6_ifa_put(ift->ifpub);
>>> + ift->ifpub = ifp;
>>> + spin_unlock(&ift->lock);
>>> + create = false;
>>> + pr_info("%s: reparent orphaned temporary address\n", __func__);
>>> + } else {
>>> + spin_unlock(&ift->lock);
>>> + continue;
>>> + }
>>> + } else {
>>> + spin_unlock(&ift->lock);
>>> + }
>>>
>>> /* RFC 4941 section 3.3:
>>> * If a received option will extend the lifetime of a public
>>>
>> After further checking it seems like the timer of the reparented temporary address was deleted. When the reparented address expires no new address is generated.
>> Have to dig deeper into it ..
> You need to reset ift->regen_count=0 to avoid that I guess.
>
> The approach seems reasonable to me.
>
> Thanks,
>
> Hannes
>
Last problem I mentioned was caused by another issue. The decribed patch has been working fine in the meantime so I'll submit it to the list.
Rgds, Heiner
prev parent reply other threads:[~2014-04-06 19:04 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
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 [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=5341A348.7010808@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 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.