- fixed id bug

This commit is contained in:
Martin Willi
2005-12-02 16:19:01 +00:00
parent 01de2f3cd5
commit 7ef7c3835a
2 changed files with 17 additions and 11 deletions
@@ -250,25 +250,31 @@ static status_t build_idr_payload(private_ike_sa_init_responded_t *this, id_payl
/* build new sa config */
init_config = this->ike_sa->get_init_config(this->ike_sa);
status = charon->configuration_manager->get_sa_config_for_init_config_and_id(charon->configuration_manager,init_config, other_id,my_id, &(this->sa_config));
other_id->destroy(other_id);
if (status != SUCCESS)
{
this->logger->log(this->logger, ERROR, "Could not find config for %s", other_id->get_string(other_id));
if (my_id)
{
my_id->destroy(my_id);
}
return NOT_FOUND;
}
/* get my id, if not requested */
if (!my_id)
{
my_id = this->sa_config->get_my_id(this->sa_config);
}
/* set sa_config in ike_sa for other states */
this->ike_sa->set_sa_config(this->ike_sa, this->sa_config);
/* build response */
idr_response = id_payload_create_from_identification(FALSE, other_id);
idr_response = id_payload_create_from_identification(FALSE, my_id);
response->add_payload(response, (payload_t*)idr_response);
if (my_id)
{
my_id->destroy(my_id);
}
other_id->destroy(other_id);
my_id->destroy(my_id);
return SUCCESS;
}