Fix a possible infinite loop in "route flush" on 64-bit archs.
MFC after: 3 days
This commit is contained in:
parent
d657a808e1
commit
0f7ce0eaaf
@ -460,8 +460,8 @@ netname(struct sockaddr *sa)
|
||||
* Guess at the subnet mask, assuming reasonable
|
||||
* width subnet fields.
|
||||
*/
|
||||
while (in.s_addr &~ mask)
|
||||
mask = (long)mask >> subnetshift;
|
||||
while (in.s_addr & ~mask)
|
||||
mask |= mask >> subnetshift;
|
||||
net = in.s_addr & mask;
|
||||
while ((mask & 1) == 0)
|
||||
mask >>= 1, net >>= 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user