]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Fixed a possible segfault after termination of IKE and child SAs.
authorTobias Brunner <tobias@strongswan.org>
Mon, 28 Feb 2011 12:19:39 +0000 (13:19 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 28 Feb 2011 12:29:09 +0000 (13:29 +0100)
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.

src/libcharon/control/controller.c

index 94c64028c26249de0f193d70cd13ada5629d4d5f..5bc19d11bde96d87f6fb02e7fa1fc39b9d08960a 100644 (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;
 }