diff options
author | Tobias Brunner <tobias@strongswan.org> | 2013-03-07 18:21:02 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-03-07 18:21:02 +0100 |
commit | 292ee515db5ecaeccf54098fb05b1beeef297a7f (patch) | |
tree | 01bef63d346d85e705bc91ad97923ece1d7baded | |
parent | d6da0a367a3a7ce02a247ed063615429fd4245cc (diff) | |
download | strongswan-292ee515db5ecaeccf54098fb05b1beeef297a7f.tar.bz2 strongswan-292ee515db5ecaeccf54098fb05b1beeef297a7f.tar.xz |
Fix maximum size of a mem_pool_t
-rw-r--r-- | src/libhydra/attributes/mem_pool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libhydra/attributes/mem_pool.c b/src/libhydra/attributes/mem_pool.c index af53e10de..f9225f68d 100644 --- a/src/libhydra/attributes/mem_pool.c +++ b/src/libhydra/attributes/mem_pool.c @@ -21,7 +21,7 @@ #include <collections/linked_list.h> #include <threading/mutex.h> -#define POOL_LIMIT (sizeof(uintptr_t)*8) +#define POOL_LIMIT (sizeof(u_int)*8 - 1) typedef struct private_mem_pool_t private_mem_pool_t; @@ -550,7 +550,7 @@ mem_pool_t *mem_pool_create(char *name, host_t *base, int bits) DBG1(DBG_CFG, "virtual IP pool too large, limiting to %H/%d", base, addr_bits - bits); } - this->size = 1 << (bits); + this->size = 1 << bits; if (this->size > 2) { /* do not use first and last addresses of a block */ |