From: David Ahern <dsahern@kernel.org>
To: "Maciej Żenczykowski" <maze@google.com>,
"Maciej Żenczykowski" <zenczykowski@gmail.com>
Cc: Linux Network Development Mailing List <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jiri@resnulli.us>
Subject: Re: [PATCH net] ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new temporary address
Date: Thu, 13 Jul 2023 08:59:35 -0600 [thread overview]
Message-ID: <ca044aea-e9ee-788c-f06d-5f148382452d@kernel.org> (raw)
In-Reply-To: <20230712135520.743211-1-maze@google.com>
On 7/12/23 7:55 AM, Maciej Żenczykowski wrote:
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index e5213e598a04..94cec2075eee 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -2561,12 +2561,18 @@ static void manage_tempaddrs(struct inet6_dev *idev,
> ipv6_ifa_notify(0, ift);
> }
>
> - if ((create || list_empty(&idev->tempaddr_list)) &&
> - idev->cnf.use_tempaddr > 0) {
> + /* Also create a temporary address if it's enabled but no temporary
> + * address currently exists.
> + * However, we get called with valid_lft == 0, prefered_lft == 0, create == false
> + * as part of cleanup (ie. deleting the mngtmpaddr).
> + * We don't want that to result in creating a new temporary ip address.
> + */
> + if (list_empty(&idev->tempaddr_list) && (valid_lft || prefered_lft))
> + create = true;
I am not so sure about this part. manage_tempaddrs has 4 callers --
autoconf (prefix receive), address add, address modify and address
delete. Seems like all of them have 'create' set properly when an
address is wanted in which case maybe the answer here is don't let empty
address list override `create`.
> +
> + if (create && idev->cnf.use_tempaddr > 0) {
> /* When a new public address is created as described
> * in [ADDRCONF], also create a new temporary address.
> - * Also create a temporary address if it's enabled but
> - * no temporary address currently exists.
> */
> read_unlock_bh(&idev->lock);
> ipv6_create_tempaddr(ifp, false);
next prev parent reply other threads:[~2023-07-13 14:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 13:55 [PATCH net] ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new temporary address Maciej Żenczykowski
2023-07-12 13:58 ` Maciej Żenczykowski
2023-07-13 14:59 ` David Ahern [this message]
2023-07-13 15:03 ` Maciej Żenczykowski
2023-07-14 14:49 ` David Ahern
2023-07-18 23:08 ` Jakub Kicinski
2023-07-18 23:18 ` David Ahern
2023-07-19 6:47 ` Jiri Pirko
2023-07-19 12:50 ` Maciej Żenczykowski
2023-07-20 15:35 ` David Ahern
2023-07-20 16:00 ` [PATCH net v2] " Maciej Żenczykowski
2023-07-20 16:34 ` Jakub Kicinski
2023-07-20 16:52 ` Maciej Żenczykowski
2023-07-24 12:07 ` Maciej Żenczykowski
2023-07-24 18:09 ` Jakub Kicinski
2023-07-24 18:20 ` Maciej Żenczykowski
2023-07-24 18:26 ` David Ahern
2023-07-24 23:00 ` patchwork-bot+netdevbpf
2023-07-25 4:59 ` Maciej Żenczykowski
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=ca044aea-e9ee-788c-f06d-5f148382452d@kernel.org \
--to=dsahern@kernel.org \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=maze@google.com \
--cc=netdev@vger.kernel.org \
--cc=zenczykowski@gmail.com \
/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.