From 4ae29195186e39702f7448bc33a4af47423e9ec2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 6 Nov 2015 14:45:57 +0100 Subject: [PATCH] mediation: Reschedule initiate mediation job if SA is not yet found If the job gets queued for a newly created IKE_SA it might not yet be checked in when the job is running, reschedule the job in that case. This should fix the two p2pnat test scenarios, which occasionally failed because one of the peers did not initiate the connection to the mediation server. --- src/libcharon/processing/jobs/initiate_mediation_job.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcharon/processing/jobs/initiate_mediation_job.c b/src/libcharon/processing/jobs/initiate_mediation_job.c index 5b5fb9d98..6c01ffe95 100644 --- a/src/libcharon/processing/jobs/initiate_mediation_job.c +++ b/src/libcharon/processing/jobs/initiate_mediation_job.c @@ -161,6 +161,10 @@ METHOD(job_t, initiate, job_requeue_t, } mediated_cfg->destroy(mediated_cfg); } + else + { /* newly created IKE_SA is not checked in yet, try again */ + return JOB_RESCHEDULE_MS(100); + } return JOB_REQUEUE_NONE; }