mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
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
@ -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 New Issue
Block a user