Skip to content

Commit

Permalink
ipv6: avoid wraparound for expired preferred lifetime
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Rosenboom authored and David S. Miller committed Jun 26, 2009
1 parent 1ac530b commit a1faa69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a1faa69

Please sign in to comment.