ike-sa-manager: Ensure we were able to create a new IKE_SA
This may happen if we are unable to allocate an SPI.
This commit is contained in:
parent
cb85967655
commit
f4258c56f5
|
@ -1501,8 +1501,11 @@ METHOD(ike_sa_manager_t, checkout_by_config, ike_sa_t*,
|
||||||
if (!this->reuse_ikesa && peer_cfg->get_ike_version(peer_cfg) != IKEV1)
|
if (!this->reuse_ikesa && peer_cfg->get_ike_version(peer_cfg) != IKEV1)
|
||||||
{ /* IKE_SA reuse disabled by config (not possible for IKEv1) */
|
{ /* IKE_SA reuse disabled by config (not possible for IKEv1) */
|
||||||
ike_sa = create_new(this, peer_cfg->get_ike_version(peer_cfg), TRUE);
|
ike_sa = create_new(this, peer_cfg->get_ike_version(peer_cfg), TRUE);
|
||||||
ike_sa->set_peer_cfg(ike_sa, peer_cfg);
|
if (ike_sa)
|
||||||
checkout_new(this, ike_sa);
|
{
|
||||||
|
ike_sa->set_peer_cfg(ike_sa, peer_cfg);
|
||||||
|
checkout_new(this, ike_sa);
|
||||||
|
}
|
||||||
charon->bus->set_sa(charon->bus, ike_sa);
|
charon->bus->set_sa(charon->bus, ike_sa);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -1573,8 +1576,11 @@ METHOD(ike_sa_manager_t, checkout_by_config, ike_sa_t*,
|
||||||
if (!ike_sa)
|
if (!ike_sa)
|
||||||
{
|
{
|
||||||
ike_sa = create_new(this, peer_cfg->get_ike_version(peer_cfg), TRUE);
|
ike_sa = create_new(this, peer_cfg->get_ike_version(peer_cfg), TRUE);
|
||||||
ike_sa->set_peer_cfg(ike_sa, peer_cfg);
|
if (ike_sa)
|
||||||
checkout_new(this, ike_sa);
|
{
|
||||||
|
ike_sa->set_peer_cfg(ike_sa, peer_cfg);
|
||||||
|
checkout_new(this, ike_sa);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
charon->bus->set_sa(charon->bus, ike_sa);
|
charon->bus->set_sa(charon->bus, ike_sa);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue