aboutsummaryrefslogtreecommitdiff
path: root/ip6.h
diff options
context:
space:
mode:
Diffstat (limited to 'ip6.h')
-rw-r--r--ip6.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ip6.h b/ip6.h
index b0c1526..9760d4f 100644
--- a/ip6.h
+++ b/ip6.h
@@ -119,9 +119,9 @@ static inline bool in6_equal_net(const struct in6_addr *a,
static inline bool in6_equal_mach(const struct in6_addr *a,
const struct in6_addr *b, int prefix_len)
{
- if (memcmp(&(a->s6_addr[(prefix_len + 7) / 8]),
- &(b->s6_addr[(prefix_len + 7) / 8]),
- 16 - (prefix_len + 7) / 8) != 0) {
+ if (memcmp(&(a->s6_addr[DIV_ROUND_UP(prefix_len, 8)]),
+ &(b->s6_addr[DIV_ROUND_UP(prefix_len, 8)]),
+ 16 - DIV_ROUND_UP(prefix_len, 8)) != 0) {
return 0;
}