- working policy installation and removal

This commit is contained in:
Martin Willi
2006-03-01 15:56:51 +00:00
parent fb8aa445d2
commit 5d187bd234
8 changed files with 345 additions and 101 deletions
+5 -2
View File
@@ -317,10 +317,14 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
if (!this->proposal)
{
this->logger->log(this->logger, CONTROL, "Proposal negotiation failed, no CHILD_SA built");
this->child_sa->destroy(this->child_sa);
this->child_sa = NULL;
}
else if (this->my_ts->get_count(this->my_ts) == 0 || this->other_ts->get_count(this->other_ts) == 0)
{
this->logger->log(this->logger, CONTROL, "Traffic selector negotiation failed, no CHILD_SA built");
this->child_sa->destroy(this->child_sa);
this->child_sa = NULL;
}
else
{
@@ -337,7 +341,7 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
this->logger->log(this->logger, AUDIT, "Could not install CHILD_SA! Deleting IKE_SA");
return DELETE_ME;
}
status = this->child_sa->add_policy(this->child_sa, this->my_ts, this->other_ts);
status = this->child_sa->add_policies(this->child_sa, this->my_ts, this->other_ts);
if (status != SUCCESS)
{
this->logger->log(this->logger, AUDIT, "Could not install CHILD_SA policy! Deleting IKE_SA");
@@ -354,7 +358,6 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
my_host->get_address(my_host), other_host->get_address(other_host),
mapping_find(auth_method_m, auth_payload->get_auth_method(auth_payload)));
this->ike_sa->create_delete_established_ike_sa_job(this->ike_sa,this->sa_config->get_ike_sa_lifetime(this->sa_config));
this->ike_sa->set_new_state(this->ike_sa, (state_t*)ike_sa_established_create(this->ike_sa));
this->destroy_after_state_change(this);
return SUCCESS;