From: Jens Rosenboom Date: Thu, 25 Jun 2009 04:55:50 +0000 (+0000) Subject: ipv6: avoid wraparound for expired preferred lifetime X-Git-Tag: firefly_0821_release~13027^2~277 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a1faa69810b2af562b70b2a71c116c7d03575dd3;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8c1e86afbbf5..3883b4036a74 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -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; }