/*
- * Copyright (C) 2011-2015 Tobias Brunner
+ * Copyright (C) 2011-2019 Tobias Brunner
* Copyright (C) 2007-2011 Martin Willi
* Copyright (C) 2011 revosec AG
* HSR Hochschule fuer Technik Rapperswil
{
switch (state)
{
-#ifdef ME
case IKE_ESTABLISHED:
- { /* mediation connections are complete without CHILD_SA */
+ {
+#ifdef ME
peer_cfg_t *peer_cfg = ike_sa->get_peer_cfg(ike_sa);
-
- if (peer_cfg->is_mediation(peer_cfg))
+#endif /* ME */
+ /* we're done if we didn't initiate a CHILD_SA */
+ if (!this->child_cfg
+#ifdef ME
+ /* the same is always true for mediation connections */
+ || peer_cfg->is_mediation(peer_cfg)
+#endif /* ME */
+ )
{
this->status = SUCCESS;
return listener_done(this);
}
break;
}
-#endif /* ME */
case IKE_DESTROYING:
return listener_done(this);
default:
peer_cfg);
if (!ike_sa)
{
- listener->child_cfg->destroy(listener->child_cfg);
+ DESTROY_IF(listener->child_cfg);
peer_cfg->destroy(peer_cfg);
listener->status = FAILED;
listener_done(listener);
"%d exceeds limit of %d", half_open, limit_half_open);
charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager,
ike_sa);
- listener->child_cfg->destroy(listener->child_cfg);
+ DESTROY_IF(listener->child_cfg);
listener->status = INVALID_STATE;
listener_done(listener);
return JOB_REQUEUE_NONE;
"limit of %d", jobs, limit_job_load);
charon->ike_sa_manager->checkin_and_destroy(
charon->ike_sa_manager, ike_sa);
- listener->child_cfg->destroy(listener->child_cfg);
+ DESTROY_IF(listener->child_cfg);
listener->status = INVALID_STATE;
listener_done(listener);
return JOB_REQUEUE_NONE;
* until the IKE_SA is established or failed.
*
* @param peer_cfg peer_cfg to use for IKE_SA setup
- * @param child_cfg child_cfg to set up CHILD_SA from
+ * @param child_cfg optional child_cfg to set up CHILD_SA from
* @param cb logging callback
* @param param parameter to include in each call of cb
* @param timeout timeout in ms to wait for callbacks, 0 to disable