summaryrefslogtreecommitdiff
path: root/src/libcharon/processing/jobs/start_action_job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/processing/jobs/start_action_job.c')
-rw-r--r--src/libcharon/processing/jobs/start_action_job.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/libcharon/processing/jobs/start_action_job.c b/src/libcharon/processing/jobs/start_action_job.c
index 5dda18be2..b65181ef8 100644
--- a/src/libcharon/processing/jobs/start_action_job.c
+++ b/src/libcharon/processing/jobs/start_action_job.c
@@ -42,6 +42,7 @@ METHOD(job_t, execute, void,
enumerator_t *enumerator, *children;
peer_cfg_t *peer_cfg;
child_cfg_t *child_cfg;
+ ipsec_mode_t mode;
char *name;
enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends,
@@ -65,11 +66,20 @@ METHOD(job_t, execute, void,
charon->controller->initiate(charon->controller,
peer_cfg->get_ref(peer_cfg),
child_cfg->get_ref(child_cfg),
- NULL, NULL);
+ NULL, NULL, 0);
break;
case ACTION_ROUTE:
DBG1(DBG_JOB, "start action: route '%s'", name);
- charon->traps->install(charon->traps, peer_cfg, child_cfg);
+ mode = child_cfg->get_mode(child_cfg);
+ if (mode == MODE_PASS || mode == MODE_DROP)
+ {
+ charon->shunts->install(charon->shunts, child_cfg);
+ }
+ else
+ {
+ charon->traps->install(charon->traps, peer_cfg,
+ child_cfg);
+ }
break;
case ACTION_NONE:
break;
@@ -81,6 +91,12 @@ METHOD(job_t, execute, void,
destroy(this);
}
+METHOD(job_t, get_priority, job_priority_t,
+ private_start_action_job_t *this)
+{
+ return JOB_PRIO_MEDIUM;
+}
+
/*
* Described in header
*/
@@ -92,10 +108,11 @@ start_action_job_t *start_action_job_create(void)
.public = {
.job_interface = {
.execute = _execute,
+ .get_priority = _get_priority,
.destroy = _destroy,
},
},
- )
+ );
return &this->public;
}