netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: avoid wraparound for expired preferred lifetime
@ 2009-06-25 14:55 Jens Rosenboom
  2009-06-26  3:10 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Rosenboom @ 2009-06-25 14:55 UTC (permalink / raw)
  To: netdev

Avoid showing wrong high values when the preferred lifetime of an address
is expired.

Signed-off-by: Jens Rosenboom <me@jayr.de>

---

Revised patch, it should suffice to only check the preferred lifetime, as
the address is deleted before the valid lifetime can wrap around.

--- linux-2.6.30.orig/net/ipv6/addrconf.c	2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30/net/ipv6/addrconf.c	2009-06-25 16:43:19.000000000 +0200
@@ -3361,7 +3361,10 @@ static int inet6_fill_ifaddr(struct sk_b
 		valid = ifa->valid_lft;
 		if (preferred != INFINITY_LIFE_TIME) {
 			long tval = (jiffies - ifa->tstamp)/HZ;
-			preferred -= tval;
+			if (preferred > tval)
+				preferred -= tval;
+			else
+				preferred = 0;
 			if (valid != INFINITY_LIFE_TIME)
 				valid -= tval;
 		}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipv6: avoid wraparound for expired preferred lifetime
  2009-06-25 14:55 [PATCH] ipv6: avoid wraparound for expired preferred lifetime Jens Rosenboom
@ 2009-06-26  3:10 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-06-26  3:10 UTC (permalink / raw)
  To: me; +Cc: netdev

From: Jens Rosenboom <me@jayr.de>
Date: Thu, 25 Jun 2009 16:55:50 +0200

> Avoid showing wrong high values when the preferred lifetime of an address
> is expired.
> 
> Signed-off-by: Jens Rosenboom <me@jayr.de>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-26  3:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-25 14:55 [PATCH] ipv6: avoid wraparound for expired preferred lifetime Jens Rosenboom
2009-06-26  3:10 ` David Miller

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).