mediation: Reschedule initiate mediation job if SA is not yet found
authorTobias Brunner <tobias@strongswan.org>
Fri, 6 Nov 2015 13:45:57 +0000 (14:45 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 9 Nov 2015 14:18:38 +0000 (15:18 +0100)
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

index 5b5fb9d..6c01ffe 100644 (file)
@@ -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;
 }