Fixed conversion of prefix length to a netmask.
This commit is contained in:
parent
2860553a86
commit
58202d8973
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219125
@ -2875,7 +2875,7 @@ makemask(struct sockaddr_storage *ssp, int bitlen)
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen;
|
||||
*p++ = (1 << bits) - 1;
|
||||
*p++ = (u_char)~0 << (CHAR_BIT - bits);
|
||||
bitlen -= bits;
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user