dect
/
linux-2.6
Archived
13
0
Fork 0

ipv6: avoid wraparound for expired preferred lifetime

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

Signed-off-by: Jens Rosenboom <me@jayr.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jens Rosenboom 2009-06-25 04:55:50 +00:00 committed by David S. Miller
parent 1ac530b355
commit a1faa69810
1 changed files with 4 additions and 1 deletions

View File

@ -3362,7 +3362,10 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
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;
}