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;
|
valid = ifa->valid_lft;
|
||||||
if (preferred != INFINITY_LIFE_TIME) {
|
if (preferred != INFINITY_LIFE_TIME) {
|
||||||
long tval = (jiffies - ifa->tstamp)/HZ;
|
long tval = (jiffies - ifa->tstamp)/HZ;
|
||||||
preferred -= tval;
|
if (preferred > tval)
|
||||||
|
preferred -= tval;
|
||||||
|
else
|
||||||
|
preferred = 0;
|
||||||
if (valid != INFINITY_LIFE_TIME)
|
if (valid != INFINITY_LIFE_TIME)
|
||||||
valid -= tval;
|
valid -= tval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue