From 89dba35fc0f22d7ceaeb171e7a50d86ed5848d57 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 24 Aug 2025 09:34:29 +0200 Subject: ipcpd: Start the connmgr first The DT component (which starts the routing component) and enrollment component rely on the connmgr, and when enrolling larger networks, the link state component sometimes fails to connect because the conngmr is not fully started yet. Signed-off-by: Dimitri Staessens --- src/ipcpd/unicast/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ipcpd/unicast/main.c b/src/ipcpd/unicast/main.c index cd0977d4..7989d3e1 100644 --- a/src/ipcpd/unicast/main.c +++ b/src/ipcpd/unicast/main.c @@ -120,6 +120,11 @@ static void finalize_components(void) static int start_components(void) { + if (connmgr_start() < 0) { + log_err("Failed to start AP connection manager."); + goto fail_connmgr_start; + } + if (dt_start() < 0) { log_err("Failed to start data transfer."); goto fail_dt_start; @@ -135,11 +140,6 @@ static int start_components(void) goto fail_enroll_start; } - if (connmgr_start() < 0) { - log_err("Failed to start AP connection manager."); - goto fail_connmgr_start; - } - if (dir_start() < 0) { log_err("Failed to start directory."); goto fail_dir_start; @@ -148,14 +148,14 @@ static int start_components(void) return 0; fail_dir_start: - connmgr_stop(); - fail_connmgr_start: enroll_stop(); fail_enroll_start: fa_stop(); fail_fa_start: dt_stop(); fail_dt_start: + connmgr_stop(); + fail_connmgr_start: ipcp_set_state(IPCP_INIT); return -1; } @@ -164,14 +164,14 @@ static void stop_components(void) { dir_stop(); - connmgr_stop(); - enroll_stop(); fa_stop(); dt_stop(); + connmgr_stop(); + ipcp_set_state(IPCP_BOOT); } -- cgit v1.2.3