diff options
author | Tobias Brunner <tobias@strongswan.org> | 2011-02-28 13:19:39 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2011-02-28 13:29:09 +0100 |
commit | dcab9d39a2d4c7ce6d85c8c505be8259db93af4b (patch) | |
tree | accfe99072c910b580851372569c1c742dbd552c /src/libcharon/control/controller.c | |
parent | e44ebdcfc8b815ef0bbe56f33708f550a38041f9 (diff) | |
download | strongswan-dcab9d39a2d4c7ce6d85c8c505be8259db93af4b.tar.bz2 strongswan-dcab9d39a2d4c7ce6d85c8c505be8259db93af4b.tar.xz |
Fixed a possible segfault after termination of IKE and child SAs.
Because the thread that is actually terminating the SA and thus checking
it in again is not be the same thread that previously checked it out and
queued the termination job, the thread local SA on the bus has to be reset
manually, similar to how it is set in the job which is executing the job.
Diffstat (limited to 'src/libcharon/control/controller.c')
-rw-r--r-- | src/libcharon/control/controller.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcharon/control/controller.c b/src/libcharon/control/controller.c index 94c64028c..5bc19d11b 100644 --- a/src/libcharon/control/controller.c +++ b/src/libcharon/control/controller.c @@ -331,6 +331,8 @@ static status_t terminate_ike(controller_t *this, u_int32_t unique_id, return terminate_ike_execute(&job); } charon->bus->listen(charon->bus, &job.listener.public, (job_t*)&job); + /* checkin of the ike_sa happend in the thread that executed the job */ + charon->bus->set_sa(charon->bus, NULL); return job.listener.status; } @@ -417,6 +419,8 @@ static status_t terminate_child(controller_t *this, u_int32_t reqid, return terminate_child_execute(&job); } charon->bus->listen(charon->bus, &job.listener.public, (job_t*)&job); + /* checkin of the ike_sa happend in the thread that executed the job */ + charon->bus->set_sa(charon->bus, NULL); return job.listener.status; } |