From 1f55a40537fef3d325737dd4fb06539d9f8e1fb9 Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Wed, 7 Jun 2017 18:55:07 +0900 Subject: [PATCH] [IPSec] Unlink UDS file for charon when charon is killed Change-Id: I2b6475c373bbf7410ecd779bc134f632ced626d5 Signed-off-by: cheoleun --- vpn/plugins/ipsec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vpn/plugins/ipsec.c b/vpn/plugins/ipsec.c index 70f3433..b33432e 100644 --- a/vpn/plugins/ipsec.c +++ b/vpn/plugins/ipsec.c @@ -1112,6 +1112,13 @@ static void check_vici_socket(struct ipsec_private_data *data) } } +static void ipsec_died(struct connman_task *task, int exit_code, void *user_data) +{ + DBG("task %p exit_code %d", task, exit_code); + unlink(VICI_DEFAULT_URI); + vpn_died(task, exit_code, user_data); +} + static int ipsec_connect(struct vpn_provider *provider, struct connman_task *task, const char *if_name, vpn_provider_connect_cb_t cb, const char *dbus_sender, @@ -1130,7 +1137,7 @@ static int ipsec_connect(struct vpn_provider *provider, /* * Start charon daemon using ipsec script of strongSwan. */ - err = connman_task_run(task, vpn_died, provider, NULL, NULL, NULL); + err = connman_task_run(task, ipsec_died, provider, NULL, NULL, NULL); if (err < 0) { connman_error("charon start failed"); if (cb) -- 2.7.4