From 77366185a8ad25c872c50eb11a8403920cd34fd4 Mon Sep 17 00:00:00 2001 From: Thomas Gschwantner Date: Sun, 29 Sep 2019 21:00:45 +0200 Subject: radix-trie: allow full use of the v4 address space --- radix-trie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'radix-trie.c') 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; -- cgit v1.2.3-59-g8ed1b