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