netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Sam Edwards <cfsworks@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [IPv6 Question] Should we remove or keep the temporary address if global address removed?
Date: Wed, 6 Nov 2024 01:39:31 +0000	[thread overview]
Message-ID: <ZyrI07Dq_YRWFk6A@fedora> (raw)
In-Reply-To: <CAH5Ym4hAz6xRnf-o32usHj8S5ESj0cpFBb7JypDVMkq2_v0x1w@mail.gmail.com>

Hi Sam,
On Tue, Nov 05, 2024 at 04:50:46PM -0800, Sam Edwards wrote:
> > After checking the code, it looks commit 778964f2fdf0 ("ipv6/addrconf: fix
> > timing bug in tempaddr regen") changes the behavior. I can't find what we should
> > do when delete the related global address from RFC8981. So I'm not sure
> > which way we should do. Keep or delete the temporary address.
> >
> > Do you have any idea?
> 
> Hi Hangbin,
> 
> RFC8981 section 3.4 does say that existing temporary addresses must
> have their lifetimes adjusted so that no temporary addresses should
> ever remain "valid" or "preferred" longer than the incoming SLAAC
> Prefix Information. This would strongly imply in Linux's case that if
> the "mngtmpaddr" address is deleted or un-flagged as such, its
> corresponding temporary addresses must be cleared out right away. That
> also makes intuitive sense to me, because if an administrator is
> deleting (or un-flagging) "mngtmpaddr" they very likely want no more
> temporary addresses within that prefix.

Thanks for the confirmation.

> 
> So, I would say what you've found is a bug. Doubly so because the
> temporaries contain a pointer to the managing address, which is
> possibly now dangling.
> 
> By the way, I don't think my patch from 2 years ago is still working
> correctly: I'm seeing that my (high-uptime) workstation has two
> mngtmpaddr addresses, one public address and one internal to my LAN,
> but currently only the "internal to my LAN" one has any
> still-preferred temporary addresses currently.
> 
> Last time around, Paolo strongly suggested that I include a regression
> test with my patch. I now realize it's a good idea to write such a
> test:
> 1. Create a dummy Ethernet interface, with temp_*_lft configured to be
> pretty short (10 and 35 seconds for prefer/valid respectively?)
> 2. Create several (3-4) mngtmpaddr addresses on that interface.
> 3. Confirm that temporary addresses are created immediately.
> 4. Confirm that a preferred temporary address exists for each
> mngtmpaddr address at all times, polling once per second for at least
> 10 minutes.
> 5. Delete each mngtmpaddr address, one at a time (alternating between
> deleting and merely un-mngtmpaddr-ing), and confirm that the other
> mngtmpaddr addresses still have preferred temporaries.
> 6. Within steps 3-5, also confirm that any temporaries that exist have
> a corresponding mngtmpaddr. (Basically the test should, at all steps,
> confirm that every existing mngtmpaddr has at least one preferred
> temporary, and that every existing temporary has a matching
> mngtmpaddr.)
> 
> This test should fail, demonstrating both of these bugs, when run
> against the latest kernel. Then we can get to work on making the test
> pass.
> 
> Are you interested in writing that test or should I? I have never
> contributed test cases to the kernel before, so there'd be a bit of a
> learning curve for me, but I'm happy to do it.

I can write the test and maybe also the fixes. But it could take at least 2
weeks as I also have some other works in hand. If you can do it more quick,
please feel free to do it first.

Thanks
Hangbin

      reply	other threads:[~2024-11-06  1:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 11:16 [IPv6 Question] Should we remove or keep the temporary address if global address removed? Hangbin Liu
2024-11-06  0:50 ` Sam Edwards
2024-11-06  1:39   ` Hangbin Liu [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=ZyrI07Dq_YRWFk6A@fedora \
    --to=liuhangbin@gmail.com \
    --cc=cfsworks@gmail.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 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).