[network-manager-openswan/dcbw/libreswan: 7/11] core: wait for connection addition to be ready



commit d2bcd115519f74156a741067f5f423e1bfceef16
Author: Dan Williams <dcbw redhat com>
Date:   Mon Oct 20 16:43:14 2014 -0500

    core: wait for connection addition to be ready
    
    Apparently we need to wait a bit before pluto is ready to talk to
    us, and if we don't, we get the error:
    
    "need --listen before --initiate"
    
    which means that pluto hasn't created the control socket that
    other pieces listen on yet.  "--ready" waits until that happens.

 src/nm-openswan-service.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index 294b4d3..1bd304a 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -64,6 +64,7 @@ typedef enum {
     CONNECT_STEP_STACK_INIT,
     CONNECT_STEP_IPSEC_START,
     CONNECT_STEP_CONFIG_ADD,
+    CONNECT_STEP_WAIT_READY,
     CONNECT_STEP_CONNECT,
     CONNECT_STEP_LAST
 } ConnectStep;
@@ -1005,6 +1006,12 @@ connect_step (NMOpenSwanPlugin *self, GError **error)
                close (fd);
                return TRUE;
 
+       case CONNECT_STEP_WAIT_READY:
+               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]