charon-nm: Terminate if signaled by NetworkManager
This only happens during shutdown, not after terminating a connection. Fixes #3579.
This commit is contained in:
parent
b422f16d10
commit
706a579e96
|
@ -14,6 +14,9 @@
|
|||
* for more details.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nm_service.h"
|
||||
#include "nm_creds.h"
|
||||
#include "nm_handler.h"
|
||||
|
@ -54,12 +57,21 @@ struct nm_backend_t {
|
|||
*/
|
||||
static nm_backend_t *nm_backend = NULL;
|
||||
|
||||
/**
|
||||
* Terminate the daemon if signaled by NM
|
||||
*/
|
||||
static void terminate(void *plugin, void *arg)
|
||||
{
|
||||
kill(getpid(), SIGTERM);
|
||||
}
|
||||
|
||||
/**
|
||||
* NM plugin processing routine, creates and handles NMVpnServicePlugin
|
||||
*/
|
||||
static job_requeue_t run(nm_backend_t *this)
|
||||
{
|
||||
this->loop = g_main_loop_new(NULL, FALSE);
|
||||
g_signal_connect(this->plugin, "quit", G_CALLBACK(terminate), NULL);
|
||||
g_main_loop_run(this->loop);
|
||||
return JOB_REQUEUE_NONE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue