if (ike_sa->has_condition(ike_sa, COND_NAT_THERE) &&
!ike_sa->has_condition(ike_sa, COND_NAT_HERE))
{
- ike_sa->update_hosts(ike_sa, NULL, this->new);
+ ike_sa->update_hosts(ike_sa, NULL, this->new, FALSE);
}
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
}
}
METHOD(ike_sa_t, update_hosts, void,
- private_ike_sa_t *this, host_t *me, host_t *other)
+ private_ike_sa_t *this, host_t *me, host_t *other, bool force)
{
bool update = FALSE;
if (!other->equals(other, this->other_host))
{
/* update others adress if we are NOT NATed */
- if (!has_condition(this, COND_NAT_HERE))
+ if (force || !has_condition(this, COND_NAT_HERE))
{
set_other_host(this, other->clone(other));
update = TRUE;
*
* @param me new local host address, or NULL
* @param other new remote host address, or NULL
+ * @param force force update
*/
- void (*update_hosts)(ike_sa_t *this, host_t *me, host_t *other);
+ void (*update_hosts)(ike_sa_t *this, host_t *me, host_t *other, bool force);
/**
* Get the own identification.
{ /* only do host updates based on verified messages */
if (!this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE))
{ /* with MOBIKE, we do no implicit updates */
- this->ike_sa->update_hosts(this->ike_sa, me, other);
+ this->ike_sa->update_hosts(this->ike_sa, me, other, mid == 1);
}
}
charon->bus->message(charon->bus, msg, TRUE);
{ /* only do host updates based on verified messages */
if (!this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE))
{ /* with MOBIKE, we do no implicit updates */
- this->ike_sa->update_hosts(this->ike_sa, me, other);
+ this->ike_sa->update_hosts(this->ike_sa, me, other, FALSE);
}
}
charon->bus->message(charon->bus, msg, TRUE);