diff options
Diffstat (limited to 'lib/prefix.c')
| -rw-r--r-- | lib/prefix.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 112630e9c8..0900100be3 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -75,10 +75,10 @@ bool is_mcast_mac(const struct ethaddr *mac) return false; } -unsigned int prefix_bit(const uint8_t *prefix, const uint16_t prefixlen) +unsigned int prefix_bit(const uint8_t *prefix, const uint16_t bit_index) { - unsigned int offset = prefixlen / 8; - unsigned int shift = 7 - (prefixlen % 8); + unsigned int offset = bit_index / 8; + unsigned int shift = 7 - (bit_index % 8); return (prefix[offset] >> shift) & 1; } |
