ike-config: Ignore unrequested virtual IP addresses

But forward them to handlers in case they requested them.
This commit is contained in:
Tobias Brunner 2019-03-28 18:44:08 +01:00
parent c334cd9f62
commit b5ac0bd35f
1 changed files with 12 additions and 0 deletions

View File

@ -41,6 +41,11 @@ struct private_ike_config_t {
*/
bool initiator;
/**
* Did we request a virtual IP?
*/
bool vip_requested;
/**
* Received list of virtual IPs, host_t*
*/
@ -149,6 +154,12 @@ static void process_attribute(private_ike_config_t *this,
/* fall */
case INTERNAL_IP6_ADDRESS:
{
if (this->initiator && !this->vip_requested)
{
handle_attribute(this, ca);
return;
}
addr = ca->get_chunk(ca);
if (addr.len == 0)
{
@ -270,6 +281,7 @@ METHOD(task_t, build_i, status_t,
cp->add_attribute(cp, build_vip(host));
}
enumerator->destroy(enumerator);
this->vip_requested = TRUE;
}
enumerator = charon->attributes->create_initiator_enumerator(