From 919349fd119bff11e9d34da09a9d71bf5675dba2 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 3 May 2018 17:49:03 +0200 Subject: ipcpd: Allow wait for dir enrollment on dt conn This adds the option to wait for the directory (DHT) to enroll on creating a new data transfer connection. This makes scripting network bootstraps more stable. The default setting is OFF. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/connmgr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ipcpd/normal/connmgr.c') diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c index 843eb280..6301baed 100644 --- a/src/ipcpd/normal/connmgr.c +++ b/src/ipcpd/normal/connmgr.c @@ -33,6 +33,7 @@ #include "comp.h" #include "connmgr.h" +#include "dir.h" #include "enroll.h" #include "ipcp.h" @@ -376,7 +377,8 @@ int connmgr_alloc(enum comp_id id, return -1; } - if (connmgr.comps[id].info.pref_version != conn->conn_info.pref_version) { + if (connmgr.comps[id].info.pref_version != + conn->conn_info.pref_version) { log_dbg("Unknown protocol version."); flow_dealloc(conn->flow_info.fd); return -1; @@ -391,6 +393,9 @@ int connmgr_alloc(enum comp_id id, switch (id) { case COMPID_DT: notifier_event(NOTIFY_DT_CONN_ADD, conn); +#ifdef IPCP_CONN_WAIT_DIR + dir_wait_running(); +#endif break; case COMPID_MGMT: notifier_event(NOTIFY_MGMT_CONN_ADD, conn); -- cgit v1.2.3