From: YOSHIFUJI Hideaki Date: Mon, 19 May 2008 23:54:29 +0000 (-0700) Subject: ipv6 addrconf: Fix route lifetime setting in corner case. X-Git-Tag: v2.6.26-rc4~7^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3264435b4ca1ccee54cbef2970f2ba4bef39e2d;p=platform%2Fkernel%2Flinux-3.10.git 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 12bba08..98aa50c 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; }