[network-manager-openswan] service: ensure the daemon is running before adding a connection



commit ac81fe76d6890af89f7a0e402891f1dc1d1862d6
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Wed Sep 2 22:32:15 2015 +0200

    service: ensure the daemon is running before adding a connection

 src/nm-openswan-service.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index 5f1767a..e83cc8b 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -63,8 +63,8 @@ typedef enum {
     CONNECT_STEP_FIRST,
     CONNECT_STEP_STACK_INIT,
     CONNECT_STEP_IPSEC_START,
-    CONNECT_STEP_CONFIG_ADD,
     CONNECT_STEP_WAIT_READY,
+    CONNECT_STEP_CONFIG_ADD,
     CONNECT_STEP_CONNECT,
     CONNECT_STEP_LAST
 } ConnectStep;
@@ -1033,6 +1033,14 @@ connect_step (NMOpenSwanPlugin *self, GError **error)
                        priv->watch_id = g_child_watch_add (priv->pid, child_watch_cb, self);
                return success;
 
+       case CONNECT_STEP_WAIT_READY:
+               if (!priv->retries)
+                       priv->retries = 30;
+               if (!do_spawn (&priv->pid, NULL, NULL, error, priv->ipsec_path, "auto", "--ready", NULL))
+                       return FALSE;
+               priv->watch_id = g_child_watch_add (priv->pid, child_watch_cb, self);
+               return TRUE;
+
        case CONNECT_STEP_CONFIG_ADD:
                if (!do_spawn (&priv->pid, &fd, NULL, error, priv->ipsec_path,
                               "auto", "--replace", "--config", "-", uuid, NULL))
@@ -1042,14 +1050,6 @@ connect_step (NMOpenSwanPlugin *self, GError **error)
                close (fd);
                return TRUE;
 
-       case CONNECT_STEP_WAIT_READY:
-               if (!priv->retries)
-                       priv->retries = 30;
-               if (!do_spawn (&priv->pid, NULL, NULL, error, priv->ipsec_path, "auto", "--ready", NULL))
-                       return FALSE;
-               priv->watch_id = g_child_watch_add (priv->pid, child_watch_cb, self);
-               return TRUE;
-
        case CONNECT_STEP_CONNECT:
                if (!spawn_pty (&up_stdout, &up_stderr, &up_pty, &priv->pid, error,
                                priv->ipsec_path, "auto", "--up", uuid, NULL))


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