netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: heiner.kallweit@web.de
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ipv6: Avoid unnecessary temporary addresses being generated
Date: Wed, 12 Mar 2014 16:48:14 -0400 (EDT)	[thread overview]
Message-ID: <20140312.164814.33998602249906578.davem@davemloft.net> (raw)
In-Reply-To: <5320BB4C.9060400@web.de>

From: Heiner Kallweit <heiner.kallweit@web.de>
Date: Wed, 12 Mar 2014 20:53:48 +0100

> @@ -1103,8 +1103,11 @@ retry:
>  	 * Lifetime is greater than REGEN_ADVANCE time units.  In particular,
>  	 * an implementation must not create a temporary address with a zero
>  	 * Preferred Lifetime.
> +	 * Use age calculation as in addrconf_verify to avoid unnecessary
> +	 * temporary addresses being generated.
>  	 */
> -	if (tmp_prefered_lft <= regen_advance) {
> +	age = (now - ifp->tstamp + ADDRCONF_TIMER_FUZZ_MINUS) / HZ;
> +	if (tmp_prefered_lft <= regen_advance + age) {

I think you must use tmp_tstamp here, we snapshot all of the values
above into local variables while holding the lock so that we calculate
a consistent set of values and tests.

  reply	other threads:[~2014-03-12 20:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 19:53 [PATCH] ipv6: Avoid unnecessary temporary addresses being generated Heiner Kallweit
2014-03-12 20:48 ` David Miller [this message]
2014-03-12 21:16   ` 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=20140312.164814.33998602249906578.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=heiner.kallweit@web.de \
    --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).