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:
parent
1ac530b355
commit
a1faa69810
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue