Commit a1faa698 authored by Jens Rosenboom's avatar Jens Rosenboom Committed by David S. Miller

ipv6: avoid wraparound for expired preferred lifetime

Avoid showing wrong high values when the preferred lifetime of an address
is expired.
Signed-off-by: default avatarJens Rosenboom <me@jayr.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ac530b3
...@@ -3362,7 +3362,10 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa, ...@@ -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;
if (preferred > tval)
preferred -= tval; preferred -= tval;
else
preferred = 0;
if (valid != INFINITY_LIFE_TIME) if (valid != INFINITY_LIFE_TIME)
valid -= tval; valid -= tval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment