unlock_single_segment(this, segment);
}
charon->bus->set_sa(charon->bus, ike_sa);
+
+ if (!ike_sa)
+ {
+ DBG2(DBG_MGR, "IKE_SA checkout not successful");
+ }
return ike_sa;
}
DBG1(DBG_MGR, "ignoring message, failed to hash message");
DESTROY_IF(hasher);
id->destroy(id);
- return NULL;
+ goto out;
}
hasher->destroy(hasher);
DBG2(DBG_MGR, "created IKE_SA %s[%u]",
ike_sa->get_name(ike_sa),
ike_sa->get_unique_id(ike_sa));
-
- charon->bus->set_sa(charon->bus, ike_sa);
- return ike_sa;
+ goto out;
}
else
{
remove_init_hash(this, hash);
chunk_free(&hash);
id->destroy(id);
- return NULL;
+ goto out;
}
case FAILED:
{ /* we failed to allocate an SPI */
chunk_free(&hash);
id->destroy(id);
DBG1(DBG_MGR, "ignoring message, failed to allocate SPI");
- return NULL;
+ goto out;
}
case ALREADY_DONE:
default:
charon->bus->alert(charon->bus, ALERT_INVALID_IKE_SPI, message);
}
id->destroy(id);
+
+out:
charon->bus->set_sa(charon->bus, ike_sa);
+ if (!ike_sa)
+ {
+ DBG2(DBG_MGR, "IKE_SA checkout not successful");
+ }
return ike_sa;
}
{ /* IKE_SA reuse disabled by config (not possible for IKEv1) */
ike_sa = checkout_new(this, peer_cfg->get_ike_version(peer_cfg), TRUE);
charon->bus->set_sa(charon->bus, ike_sa);
- return ike_sa;
+ goto out;
}
enumerator = create_table_enumerator(this);
ike_sa = checkout_new(this, peer_cfg->get_ike_version(peer_cfg), TRUE);
}
charon->bus->set_sa(charon->bus, ike_sa);
+
+out:
+ if (!ike_sa)
+ {
+ DBG2(DBG_MGR, "IKE_SA checkout not successful");
+ }
return ike_sa;
}
DBG2(DBG_MGR, "IKE_SA %s[%u] successfully checked out",
ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa));
}
+ else
+ {
+ DBG2(DBG_MGR, "IKE_SA checkout not successful");
+ }
charon->bus->set_sa(charon->bus, ike_sa);
return ike_sa;
}
enumerator->destroy(enumerator);
charon->bus->set_sa(charon->bus, ike_sa);
+
+ if (!ike_sa)
+ {
+ DBG2(DBG_MGR, "IKE_SA checkout not successful");
+ }
return ike_sa;
}
entry->other = other->clone(other);
put_half_open(this, entry);
}
- DBG2(DBG_MGR, "checkin of IKE_SA successful");
entry->condvar->signal(entry->condvar);
}
else
}
segment = put_entry(this, entry);
}
+ DBG2(DBG_MGR, "checkin of IKE_SA successful");
/* apply identities for duplicate test */
if ((ike_sa->get_state(ike_sa) == IKE_ESTABLISHED ||