controller: Make child config optional for initiate()
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -265,19 +265,24 @@ METHOD(listener_t, ike_state_change, bool,
|
||||
{
|
||||
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:
|
||||
@@ -414,7 +419,7 @@ METHOD(job_t, initiate_execute, job_requeue_t,
|
||||
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);
|
||||
@@ -446,7 +451,7 @@ METHOD(job_t, initiate_execute, job_requeue_t,
|
||||
"%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;
|
||||
@@ -465,7 +470,7 @@ METHOD(job_t, initiate_execute, job_requeue_t,
|
||||
"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;
|
||||
|
||||
@@ -78,7 +78,7 @@ struct controller_t {
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user