'addrlen' does not matter when we need to find the first non-zero bit in

the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com
MFC after:      7 days
This commit is contained in:
Andrey A. Chernov 2016-08-31 18:49:50 +00:00
parent bce38b9f35
commit e1ec67bbc9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305144
2 changed files with 2 additions and 2 deletions

View File

@ -949,7 +949,7 @@ matchlen(struct sockaddr *src, struct sockaddr *dst)
while (s < lim)
if ((r = (*d++ ^ *s++)) != 0) {
while (r < addrlen * 8) {
while ((r & 0x80) == 0) {
match++;
r <<= 1;
}

View File

@ -930,7 +930,7 @@ matchlen(struct sockaddr *src, struct sockaddr *dst)
while (s < lim)
if ((r = (*d++ ^ *s++)) != 0) {
while (r < addrlen * 8) {
while ((r & 0x80) == 0) {
match++;
r <<= 1;
}