diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-09-29 21:00:45 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-12-11 06:22:17 +0100 |
commit | 77366185a8ad25c872c50eb11a8403920cd34fd4 (patch) | |
tree | 170bfb45fa5799c2078f8a33d91e59f87f78df72 /radix-trie.c | |
parent | Rename struct ip_pool to be more descriptive (diff) | |
download | wg-dynamic-77366185a8ad25c872c50eb11a8403920cd34fd4.tar.xz wg-dynamic-77366185a8ad25c872c50eb11a8403920cd34fd4.zip |
radix-trie: allow full use of the v4 address space
Diffstat (limited to 'radix-trie.c')
-rw-r--r-- | radix-trie.c | 4 |
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; |