[network-manager-openvpn/lr/multiple-vpn: 7/7] service: ensure the service is disconnected when doing a new connection



commit 3ea01044b8f0082fbc4cc1d44c1aa80c42cc4b9a
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Aug 21 20:16:39 2015 +0200

    service: ensure the service is disconnected when doing a new connection
    
    mgt_path is not freed when an activation fails and Disconnect is not called,
    let's do it upon reconnect otherwise the mgt_path == NULL assert will get git.

 src/nm-openvpn-service.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 0f154de..834d7d0 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1575,6 +1575,11 @@ _connect_common (NMVpnServicePlugin   *plugin,
        const char *connection_type;
        const char *user_name;
 
+       if (!real_disconnect (plugin, error)) {
+               g_warning ("Could not clean up previous daemon run: %s", (*error)->message);
+               g_clear_error (error);
+       }
+
        s_vpn = nm_connection_get_setting_vpn (connection);
        if (!s_vpn) {
                g_set_error_literal (error,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]