removing fix applied by Changeset 4378
This commit is contained in:
parent
ec6a88f617
commit
c85862931f
|
@ -698,16 +698,14 @@ static bool addr_in_subnet(chunk_t addr, chunk_t net, int net_len)
|
|||
/* scan through all bits, beginning in the front */
|
||||
for (byte = 0; byte < addr.len; byte++)
|
||||
{
|
||||
for (bit = 0; bit < 8; bit++)
|
||||
for (bit = 7; bit >= 0; bit--)
|
||||
{
|
||||
u_char bitpos = 1 << (7-bit);
|
||||
|
||||
/* check if bits are equal (or we reached the end of the net) */
|
||||
if (bit + byte * 8 > net_len)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if ((bitpos & addr.ptr[byte]) != (bitpos & net.ptr[byte]))
|
||||
if (((1<<bit) & addr.ptr[byte]) != ((1<<bit) & net.ptr[byte]))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue