child-create: Don't log CHILD_SA initiation until we know the unique ID

This commit is contained in:
Tobias Brunner 2017-08-07 13:59:37 +02:00
parent 663b749c9f
commit 7bcd48d1b1
1 changed files with 13 additions and 11 deletions

View File

@ -1022,17 +1022,6 @@ METHOD(task_t, build_i, status_t,
break;
}
if (this->reqid)
{
DBG0(DBG_IKE, "establishing CHILD_SA %s{%d}",
this->config->get_name(this->config), this->reqid);
}
else
{
DBG0(DBG_IKE, "establishing CHILD_SA %s",
this->config->get_name(this->config));
}
/* check if we want a virtual IP, but don't have one */
list = linked_list_create();
peer_cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
@ -1085,6 +1074,19 @@ METHOD(task_t, build_i, status_t,
this->ike_sa->has_condition(this->ike_sa, COND_NAT_ANY),
this->mark_in, this->mark_out);
if (this->reqid)
{
DBG0(DBG_IKE, "establishing CHILD_SA %s{%d} reqid %d",
this->child_sa->get_name(this->child_sa),
this->child_sa->get_unique_id(this->child_sa), this->reqid);
}
else
{
DBG0(DBG_IKE, "establishing CHILD_SA %s{%d}",
this->child_sa->get_name(this->child_sa),
this->child_sa->get_unique_id(this->child_sa));
}
if (!allocate_spi(this))
{
DBG1(DBG_IKE, "unable to allocate SPIs from kernel");