[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <dd125a7f86968371046d.1206305169@pirzuine>
Date: Sun, 23 Mar 2008 21:46:09 +0100
From: Benoit Boissinot <benoit.boissinot@...-lyon.org>
To: netdev@...r.kernel.org
Cc: pekkas@...core.fi, yoshfuji@...ux-ipv6.org
Subject: [PATCH 1 of 5] IPv6: do not wrap around when the lifetime has expired
IPv6: do not wrap around when the lifetime has expired
Instead of reporting overly large lifetimes to userspace,
report a lifetime of 0 when a lifetime has expired.
Signed-off-by: Benoit Boissinot <benoit.boissinot@...-lyon.org>
diff -r c6c17f6335a1 -r dd125a7f8696 net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c Sat Mar 22 14:33:51 2008 +0100
+++ b/net/ipv6/addrconf.c Sat Mar 22 00:50:21 2008 +0100
@@ -3230,10 +3230,17 @@
preferred = ifa->prefered_lft;
valid = ifa->valid_lft;
if (preferred != INFINITY_LIFE_TIME) {
- long tval = (jiffies - ifa->tstamp)/HZ;
- preferred -= tval;
- if (valid != INFINITY_LIFE_TIME)
- valid -= tval;
+ unsigned long tval = (jiffies - ifa->tstamp)/HZ;
+ if (tval > preferred)
+ preferred = 0;
+ else
+ preferred -= tval;
+ if (valid != INFINITY_LIFE_TIME) {
+ if (tval > valid)
+ valid = 0;
+ else
+ valid -= tval;
+ }
}
} else {
preferred = INFINITY_LIFE_TIME;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists