aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-05-02 13:56:17 +0200
committerMartin Willi <martin@revosec.ch>2011-05-16 15:24:13 +0200
commitea69c70d0ec8627a8637ab61ced4f966cf0b22fc (patch)
tree3159cd3b88e542534112e75a7e5755d35beeecc7 /src/libcharon
parent68f56418cd5d8a61ec0f7a1ecc72938c7ee9e724 (diff)
downloadstrongswan-ea69c70d0ec8627a8637ab61ced4f966cf0b22fc.tar.bz2
strongswan-ea69c70d0ec8627a8637ab61ced4f966cf0b22fc.tar.xz
Use job priorities in process_message job based on exchange types
Diffstat (limited to 'src/libcharon')
-rw-r--r--src/libcharon/processing/jobs/process_message_job.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libcharon/processing/jobs/process_message_job.c b/src/libcharon/processing/jobs/process_message_job.c
index c5c5f07c9..a4924d001 100644
--- a/src/libcharon/processing/jobs/process_message_job.c
+++ b/src/libcharon/processing/jobs/process_message_job.c
@@ -87,7 +87,22 @@ METHOD(job_t, execute, void,
METHOD(job_t, get_priority, job_priority_t,
private_process_message_job_t *this)
{
- return JOB_PRIO_MEDIUM;
+ switch (this->message->get_exchange_type(this->message))
+ {
+ case IKE_AUTH:
+ /* IKE auth is rather expensive and often blocking, low priority */
+ return JOB_PRIO_LOW;
+ case INFORMATIONAL:
+ /* INFORMATIONALs are inexpensive, for DPD we should have low
+ * reaction times */
+ return JOB_PRIO_HIGH;
+ case IKE_SA_INIT:
+ case CREATE_CHILD_SA:
+ default:
+ /* IKE_SA_INIT is expensive, but we will drop them in the receiver
+ * if we are overloaded */
+ return JOB_PRIO_MEDIUM;
+ }
}
/*