mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
16 lines
631 B
Diff
16 lines
631 B
Diff
When IPv6 address mask did not end on an octed boundary, the the opposite
|
|
part of last byte of host address was taken into account when a match was
|
|
attempted. -- Lubomir Kundrak <lkundrak@redhat.com>
|
|
|
|
--- jwhois-4.0/src/lookup.c.ipv6-match 2007-12-04 17:09:57.000000000 +0100
|
|
+++ jwhois-4.0/src/lookup.c 2007-12-04 17:10:20.000000000 +0100
|
|
@@ -149,7 +149,7 @@ static int ipv6_address_is_in_network(co
|
|
}
|
|
/* i == bits / 8 */
|
|
if (bits % 8 != 0
|
|
- && (addr->s6_addr[i] & (0xFFu << (bits % 8))) != net->s6_addr[i])
|
|
+ && (addr->s6_addr[i] & (0xFFu << 8-(bits % 8))) != net->s6_addr[i])
|
|
return 0;
|
|
return 1;
|
|
}
|