pluto now supports SQL-based virtual IP pools
This commit is contained in:
@@ -320,7 +320,7 @@ static bool release_address(private_stroke_attribute_t *this,
|
||||
*/
|
||||
static void add_pool(private_stroke_attribute_t *this, stroke_msg_t *msg)
|
||||
{
|
||||
if (msg->add_conn.other.sourceip_size)
|
||||
if (msg->add_conn.other.sourceip_mask)
|
||||
{
|
||||
pool_t *pool;
|
||||
|
||||
@@ -344,7 +344,7 @@ static void add_pool(private_stroke_attribute_t *this, stroke_msg_t *msg)
|
||||
|
||||
DBG1(DBG_CFG, "adding virtual IP address pool '%s': %s/%d",
|
||||
msg->add_conn.name, msg->add_conn.other.sourceip,
|
||||
msg->add_conn.other.sourceip_size);
|
||||
msg->add_conn.other.sourceip_mask);
|
||||
|
||||
pool->base = host_create_from_string(msg->add_conn.other.sourceip, 0);
|
||||
if (!pool->base)
|
||||
@@ -354,7 +354,7 @@ static void add_pool(private_stroke_attribute_t *this, stroke_msg_t *msg)
|
||||
return;
|
||||
}
|
||||
family = pool->base->get_family(pool->base);
|
||||
bits = (family == AF_INET ? 32 : 128) - msg->add_conn.other.sourceip_size;
|
||||
bits = (family == AF_INET ? 32 : 128) - msg->add_conn.other.sourceip_mask;
|
||||
if (bits > POOL_LIMIT)
|
||||
{
|
||||
bits = POOL_LIMIT;
|
||||
|
||||
@@ -583,7 +583,7 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this,
|
||||
{
|
||||
rekey = msg->add_conn.rekey.ike_lifetime - over;
|
||||
}
|
||||
if (msg->add_conn.me.sourceip_size)
|
||||
if (msg->add_conn.me.sourceip_mask)
|
||||
{
|
||||
if (msg->add_conn.me.sourceip)
|
||||
{
|
||||
@@ -641,7 +641,7 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this,
|
||||
msg->add_conn.me.sendcert, unique,
|
||||
msg->add_conn.rekey.tries, rekey, reauth, jitter, over,
|
||||
msg->add_conn.mobike, msg->add_conn.dpd.delay,
|
||||
vip, msg->add_conn.other.sourceip_size ?
|
||||
vip, msg->add_conn.other.sourceip_mask ?
|
||||
msg->add_conn.name : msg->add_conn.other.sourceip,
|
||||
msg->add_conn.ikeme.mediation, mediated_by, peer_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user