summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-05-19 16:54:29 -0700
committerDavid S. Miller <davem@davemloft.net>2008-05-19 16:54:29 -0700
commita3264435b4ca1ccee54cbef2970f2ba4bef39e2d (patch)
tree179467e618008c397aff4d990fd0e6aad77edc2c /net
parent44dc19c829c057dc78a5ffacaf851ac4c301eb58 (diff)
downloadkernel-crypto-a3264435b4ca1ccee54cbef2970f2ba4bef39e2d.tar.gz
kernel-crypto-a3264435b4ca1ccee54cbef2970f2ba4bef39e2d.tar.xz
kernel-crypto-a3264435b4ca1ccee54cbef2970f2ba4bef39e2d.zip
ipv6 addrconf: Fix route lifetime setting in corner case.
Because of arithmetic overflow avoidance, the actual lifetime setting (vs the value given by RA) did not increase monotonically around 0x7fffffff/HZ. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 12bba088034..98aa50c11dd 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -475,7 +475,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
lifetime = ntohl(rinfo->lifetime);
if (lifetime == 0xffffffff) {
/* infinity */
- } else if (lifetime > 0x7fffffff/HZ) {
+ } else if (lifetime > 0x7fffffff/HZ - 1) {
/* Avoid arithmetic overflow */
lifetime = 0x7fffffff/HZ - 1;
}