mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue