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.
This commit is contained in:
Tobias Brunner
2011-02-28 13:29:09 +01:00
parent e44ebdcfc8
commit dcab9d39a2
+4
View File
@@ -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;
}