diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-07-28 03:25:08 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-08-02 21:49:15 +0200 |
commit | f7aae442151c3f18cd542b8260601759658ca460 (patch) | |
tree | ab0ccfc1a45e4bc9e038f3837ebc93fcd7d1e58d /radix-trie.h | |
parent | Move counting logic from lease.c to radix-trie.c (diff) | |
download | wg-dynamic-f7aae442151c3f18cd542b8260601759658ca460.tar.xz wg-dynamic-f7aae442151c3f18cd542b8260601759658ca460.zip |
radix-trie: implement pool shadowing
Pools are created from routes which can overlap. Consider the following:
ip route add 192.168.4.0/28
ip route add 192.168.4.0/24
sleep 3600
ip route del 192.168.4.0/24
Here, the pool created from the first route is being shadowed by the
pool from the second route. However, since the second pool is later
removed again we cannot simply combine them. So instead this commit
shadows them, to avoid them being double counted.
Diffstat (limited to 'radix-trie.h')
-rw-r--r-- | radix-trie.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/radix-trie.h b/radix-trie.h index 60d383b..a72ee50 100644 --- a/radix-trie.h +++ b/radix-trie.h @@ -30,9 +30,8 @@ void ipp_addnth_v4(struct ip_pool *pool, struct in_addr *dest, uint32_t index); void ipp_addnth_v6(struct ip_pool *pool, struct in6_addr *dest, uint32_t index_low, uint64_t index_high); -int ipp_addpool_v4(struct ip_pool *pool, const struct in_addr *ip, - uint8_t cidr); -int ipp_addpool_v6(struct ip_pool *pool, const struct in6_addr *ip, +int ipp_addpool_v4(struct ip_pool *ipp, const struct in_addr *ip, uint8_t cidr); +int ipp_addpool_v6(struct ip_pool *ipp, const struct in6_addr *ip, uint8_t cidr); int ipp_removepool_v4(struct ip_pool *pool, const struct in_addr *ip); |