mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 08:09:08 +00:00
Fix 4-byte overflow in ipv6_writemask.
This bug could cause some IPv6 table prefix delete requests to fail. Obtained from: Yandex LLC
This commit is contained in:
parent
912517a7d4
commit
37aefa2ad1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=301440
@ -590,7 +590,8 @@ ipv6_writemask(struct in6_addr *addr6, uint8_t mask)
|
||||
|
||||
for (cp = (uint32_t *)addr6; mask >= 32; mask -= 32)
|
||||
*cp++ = 0xFFFFFFFF;
|
||||
*cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0);
|
||||
if (mask > 0)
|
||||
*cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user