diff options
author | Jens Rosenboom <me@jayr.de> | 2009-06-25 04:55:50 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-26 03:03:50 (GMT) |
commit | a1faa69810b2af562b70b2a71c116c7d03575dd3 (patch) | |
tree | 074a4b79742f1749eafc5e539f3241e5d57d8236 | |
parent | 1ac530b3553e0b4dc1e18a32bed57cfa84cd57cb (diff) | |
download | linux-fsl-qoriq-a1faa69810b2af562b70b2a71c116c7d03575dd3.tar.xz |
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>
-rw-r--r-- | net/ipv6/addrconf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8c1e86a..3883b40 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; } |