aboutsummaryrefslogtreecommitdiffstats
path: root/radix-trie.c
diff options
context:
space:
mode:
Diffstat (limited to 'radix-trie.c')
-rw-r--r--radix-trie.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/radix-trie.c b/radix-trie.c
index f8ff629..3557063 100644
--- a/radix-trie.c
+++ b/radix-trie.c
@@ -380,7 +380,7 @@ static int remove_node(struct radix_node *trie, const uint8_t *key,
static void totalip_inc(struct ipns *ns, uint8_t bits, uint8_t val)
{
if (bits == 32) {
- BUG_ON(val >= 32);
+ BUG_ON(val > 32);
ns->total_ipv4 += 1ULL << val;
} else if (bits == 128) {
uint64_t tmp = ns->totall_ipv6;
@@ -394,7 +394,7 @@ static void totalip_inc(struct ipns *ns, uint8_t bits, uint8_t val)
static void totalip_dec(struct ipns *ns, uint8_t bits, uint8_t val)
{
if (bits == 32) {
- BUG_ON(val >= 32);
+ BUG_ON(val > 32);
ns->total_ipv4 -= 1ULL << val;
} else if (bits == 128) {
uint64_t tmp = ns->totall_ipv6;