Subject: Re: [PATCH 1/1] ipv6 addrconf:fix preferred lifetime state-changing behavior while valid_lft is infinity

From: Sergei Shtylyov <[email-masked]>
Date: Thu, 12 Dec 2013 18:06:56 +0400

Hello.

On 12-12-2013 14:15, [email-masked] wrote:

> From: Yasushi Asano <[email-masked]>

>   Fixed a problem with setting the lifetime of an IPv6
>   address. When setting preferred_lft to a value not zero or
>   infinity, while valid_lft is infinity(0xffffffff) preferred
>   lifetime is set to forever and does not update. Therefore
>   preferred lifetime never becomes deprecated. valid lifetime
>   and preferred lifetime should be set independently, even if
>   valid lifetime is infinity, preferred lifetime must expire
>   correctly (meaning it must eventually become deprecated)

> Signed-off-by: Yasushi Asano <[email-masked]>
> ---
>   net/ipv6/addrconf.c |   34 ++++++++++++++++++++--------------
>   1 files changed, 20 insertions(+), 14 deletions(-)

> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 3c3425e..17b4097 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -948,18 +948,22 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
[...]
> +					if (ifp->valid_lft !=
> +						INFINITY_LIFE_TIME) {

    Please start the continuation line right under 'ifp', according to the 
networking coding style -- this ways it's easier on the eyes and don't mix 
with the following block.

> +						spin_lock(&ifa->lock);
> +
> +						lifetime = addrconf_timeout_fixup(
> +								ifa->valid_lft,	HZ);
> +						/*
> +						 * Note: Because this address is

    s/Because/because/, so that the grammar is correct.

> +						 * not permanent, lifetime <
> +						 * LONG_MAX / HZ here.
> +						 */

    Networking code assumes slightly other style of multi-line comments:

/* bla
  * bla
  */

WBR, Sergei