summaryrefslogtreecommitdiff
path: root/src/charon/control/controller.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2009-03-01 10:48:08 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2009-03-01 10:48:08 +0000
commita6f902baed7abb17a1a9c014e01bb100077f8198 (patch)
tree82114e22e251e9260d9a712f1232e52e1ef494e3 /src/charon/control/controller.c
parent1450c9df799b0870477f6e63357f4bcb63537f4f (diff)
downloadvyos-strongswan-a6f902baed7abb17a1a9c014e01bb100077f8198.tar.gz
vyos-strongswan-a6f902baed7abb17a1a9c014e01bb100077f8198.zip
- Updated to new upstream revision.
Diffstat (limited to 'src/charon/control/controller.c')
-rw-r--r--src/charon/control/controller.c49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/charon/control/controller.c b/src/charon/control/controller.c
index ed52cb0d6..989167a53 100644
--- a/src/charon/control/controller.c
+++ b/src/charon/control/controller.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: controller.c 4434 2008-10-14 08:52:13Z martin $
+ * $Id: controller.c 4704 2008-11-26 14:32:55Z martin $
*/
#include "controller.h"
@@ -235,12 +235,13 @@ static status_t initiate_execute(interface_job_t *job)
}
peer_cfg->destroy(peer_cfg);
- if (ike_sa->initiate(ike_sa, listener->child_cfg) != SUCCESS)
+ if (ike_sa->initiate(ike_sa, listener->child_cfg) == SUCCESS)
{
- return charon->ike_sa_manager->checkin_and_destroy(
- charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ return SUCCESS;
}
- return charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager, ike_sa);
+ return FAILED;
}
/**
@@ -285,12 +286,15 @@ static status_t terminate_ike_execute(interface_job_t *job)
ike_sa_t *ike_sa = listener->ike_sa;
charon->bus->set_sa(charon->bus, ike_sa);
- if (ike_sa->delete(ike_sa) == DESTROY_ME)
+
+ if (ike_sa->delete(ike_sa) != DESTROY_ME)
{
- return charon->ike_sa_manager->checkin_and_destroy(
- charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ /* delete failed */
+ return FAILED;
}
- return charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager, ike_sa);
+ return SUCCESS;
}
/**
@@ -346,12 +350,13 @@ static status_t terminate_child_execute(interface_job_t *job)
charon->bus->set_sa(charon->bus, ike_sa);
if (ike_sa->delete_child_sa(ike_sa, child_sa->get_protocol(child_sa),
- child_sa->get_spi(child_sa, TRUE)) == DESTROY_ME)
+ child_sa->get_spi(child_sa, TRUE)) != DESTROY_ME)
{
- return charon->ike_sa_manager->checkin_and_destroy(
- charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ return SUCCESS;
}
- return charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager, ike_sa);
+ return FAILED;
}
/**
@@ -429,12 +434,13 @@ static status_t route_execute(interface_job_t *job)
ike_sa_t *ike_sa = listener->ike_sa;
charon->bus->set_sa(charon->bus, ike_sa);
- if (ike_sa->route(ike_sa, listener->child_cfg) == DESTROY_ME)
+ if (ike_sa->route(ike_sa, listener->child_cfg) != DESTROY_ME)
{
- return charon->ike_sa_manager->checkin_and_destroy(
- charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ return SUCCESS;
}
- return charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager, ike_sa);
+ return FAILED;
}
/**
@@ -487,12 +493,13 @@ static status_t unroute_execute(interface_job_t *job)
interface_listener_t *listener = &job->listener;
ike_sa_t *ike_sa = listener->ike_sa;
- if (ike_sa->unroute(ike_sa, listener->id) == DESTROY_ME)
+ if (ike_sa->unroute(ike_sa, listener->id) != DESTROY_ME)
{
- return charon->ike_sa_manager->checkin_and_destroy(
- charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ return SUCCESS;
}
- return charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
+ charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager, ike_sa);
+ return SUCCESS;
}
/**