[network-manager-openswan/dcbw/libreswan: 8/12] core: wait for connection addition to be ready
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openswan/dcbw/libreswan: 8/12] core: wait for connection addition to be ready
- Date: Tue, 2 Dec 2014 01:02:58 +0000 (UTC)
commit 36fa8087c5d333508545caa8d30ffeecfdd122f3
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
whack listens 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 3f33700..be9e11d 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;
@@ -986,6 +987,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, pluto_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]