mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 01:21:28 +00:00
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>
This commit is contained in:
parent
44dc19c829
commit
a3264435b4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user