Clear traps during shutdown before unloading kernel plugins
This commit is contained in:
@@ -106,6 +106,10 @@ static void destroy(private_daemon_t *this)
|
|||||||
{
|
{
|
||||||
this->public.ike_sa_manager->flush(this->public.ike_sa_manager);
|
this->public.ike_sa_manager->flush(this->public.ike_sa_manager);
|
||||||
}
|
}
|
||||||
|
if (this->public.traps)
|
||||||
|
{
|
||||||
|
this->public.traps->flush(this->public.traps);
|
||||||
|
}
|
||||||
DESTROY_IF(this->public.receiver);
|
DESTROY_IF(this->public.receiver);
|
||||||
DESTROY_IF(this->public.sender);
|
DESTROY_IF(this->public.sender);
|
||||||
/* unload plugins to release threads */
|
/* unload plugins to release threads */
|
||||||
|
|||||||
@@ -350,6 +350,12 @@ METHOD(listener_t, child_state_change, bool,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(trap_manager_t, flush, void,
|
||||||
|
private_trap_manager_t *this)
|
||||||
|
{
|
||||||
|
this->traps->invoke_function(this->traps, (void*)destroy_entry);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(trap_manager_t, destroy, void,
|
METHOD(trap_manager_t, destroy, void,
|
||||||
private_trap_manager_t *this)
|
private_trap_manager_t *this)
|
||||||
{
|
{
|
||||||
@@ -373,6 +379,7 @@ trap_manager_t *trap_manager_create(void)
|
|||||||
.uninstall = _uninstall,
|
.uninstall = _uninstall,
|
||||||
.create_enumerator = _create_enumerator,
|
.create_enumerator = _create_enumerator,
|
||||||
.acquire = _acquire,
|
.acquire = _acquire,
|
||||||
|
.flush = _flush,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
.listener = {
|
.listener = {
|
||||||
|
|||||||
@@ -67,6 +67,11 @@ struct trap_manager_t {
|
|||||||
void (*acquire)(trap_manager_t *this, u_int32_t reqid,
|
void (*acquire)(trap_manager_t *this, u_int32_t reqid,
|
||||||
traffic_selector_t *src, traffic_selector_t *dst);
|
traffic_selector_t *src, traffic_selector_t *dst);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear any installed trap.
|
||||||
|
*/
|
||||||
|
void (*flush)(trap_manager_t *this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy a trap_manager_t.
|
* Destroy a trap_manager_t.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user