diff options
-rw-r--r-- | ot_accesslist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ot_accesslist.c b/ot_accesslist.c index 181c8f0..1badc25 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c | |||
@@ -385,10 +385,10 @@ void accesslist_cleanup( void ) { | |||
385 | #endif | 385 | #endif |
386 | 386 | ||
387 | int address_in_net( const ot_ip6 address, const ot_net *net ) { | 387 | int address_in_net( const ot_ip6 address, const ot_net *net ) { |
388 | int bits = net->bits; | 388 | int bits = net->bits, checkbits = ( 0x7f00 >> ( bits & 7 )); |
389 | int result = memcmp( address, &net->address, bits >> 3 ); | 389 | int result = memcmp( address, &net->address, bits >> 3 ); |
390 | if( !result && ( bits & 7 ) ) | 390 | if( !result && ( bits & 7 ) ) |
391 | result = ( ( 0x7f00 >> ( bits & 7 ) ) & address[bits>>3] ) - net->address[bits>>3]; | 391 | result = ( checkbits & address[bits>>3] ) - ( checkbits & net->address[bits>>3]); |
392 | return result == 0; | 392 | return result == 0; |
393 | } | 393 | } |
394 | 394 | ||