fixed virtual IP re-installation failure in MOBIKE scenarios introduced with changeset 4662

This commit is contained in:
Andreas Steffen
2008-11-17 00:01:34 +00:00
parent 9a095db5e8
commit 08c6ed9f14
+19 -13
View File
@@ -662,6 +662,7 @@ static status_t update_hosts(private_child_sa_t *this,
host_t *me, host_t *other, host_t *vip, bool encap) host_t *me, host_t *other, host_t *vip, bool encap)
{ {
child_sa_state_t old; child_sa_state_t old;
bool transport_proxy_mode;
/* anything changed at all? */ /* anything changed at all? */
if (me->equals(me, this->my_addr) && if (me->equals(me, this->my_addr) &&
@@ -672,8 +673,10 @@ static status_t update_hosts(private_child_sa_t *this,
old = this->state; old = this->state;
set_state(this, CHILD_UPDATING); set_state(this, CHILD_UPDATING);
transport_proxy_mode = this->config->use_proxy_mode(this->config) &&
this->mode == MODE_TRANSPORT;
if (!this->config->use_proxy_mode(this->config) || this->mode != MODE_TRANSPORT) if (!transport_proxy_mode)
{ {
/* update our (initator) SA */ /* update our (initator) SA */
if (this->my_spi) if (this->my_spi)
@@ -700,18 +703,6 @@ static status_t update_hosts(private_child_sa_t *this,
return NOT_SUPPORTED; return NOT_SUPPORTED;
} }
} }
/* apply hosts */
if (!me->equals(me, this->my_addr))
{
this->my_addr->destroy(this->my_addr);
this->my_addr = me->clone(me);
}
if (!other->equals(other, this->other_addr))
{
this->other_addr->destroy(this->other_addr);
this->other_addr = other->clone(other);
}
} }
if (this->config->install_policy(this->config)) if (this->config->install_policy(this->config))
@@ -779,6 +770,21 @@ static status_t update_hosts(private_child_sa_t *this,
} }
} }
if (!transport_proxy_mode)
{
/* apply hosts */
if (!me->equals(me, this->my_addr))
{
this->my_addr->destroy(this->my_addr);
this->my_addr = me->clone(me);
}
if (!other->equals(other, this->other_addr))
{
this->other_addr->destroy(this->other_addr);
this->other_addr = other->clone(other);
}
}
this->encap = encap; this->encap = encap;
set_state(this, old); set_state(this, old);