Thread (21 messages) 21 messages, 5 authors, 2014-01-03

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

From: Sergei Shtylyov <hidden>
Date: 2013-12-12 14:06:54

Hello.

On 12-12-2013 14:15, yazzep@gmail.com wrote:
From: Yasushi Asano <redacted>
  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 <redacted>
---
  net/ipv6/addrconf.c |   34 ++++++++++++++++++++--------------
  1 files changed, 20 insertions(+), 14 deletions(-)
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help