Commit c64b7f6a authored by Simon Kelley's avatar Simon Kelley

Fix is_same_net6 - bugged if prefix length not divisible by 8.

parent 068b4b51
...@@ -8,6 +8,10 @@ version 2.62 ...@@ -8,6 +8,10 @@ version 2.62
advertisements with some configurations. Thanks to advertisements with some configurations. Thanks to
Vladislav Grishenko for the patch. Vladislav Grishenko for the patch.
Fixed bug which broke DHCPv6/RA with prefix lengths
which are not divisible by 8. Thanks to Andre Coetzee
for spotting this.
version 2.61 version 2.61
Re-write interface discovery code on *BSD to use Re-write interface discovery code on *BSD to use
......
...@@ -330,7 +330,7 @@ int is_same_net6(struct in6_addr *a, struct in6_addr *b, int prefixlen) ...@@ -330,7 +330,7 @@ int is_same_net6(struct in6_addr *a, struct in6_addr *b, int prefixlen)
return 0; return 0;
if (pfbits == 0 || if (pfbits == 0 ||
(a->s6_addr[pfbytes] >> (8 - pfbits) != b->s6_addr[pfbytes] >> (8 - pfbits))) (a->s6_addr[pfbytes] >> (8 - pfbits) == b->s6_addr[pfbytes] >> (8 - pfbits)))
return 1; return 1;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment