From 155fbfb32b9a69705a06a5771bd146c1bed22821 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 10 Aug 2016 12:27:41 +0200 Subject: ipcp, irmd, lib: Notify IRMd upon IPCP initialization This will notify the IRMd when the IPCP is initialized and ready to receive messages. Previously a bootstrap could fail since the IPCP was not listening to the socket yet. --- src/ipcpd/normal/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ipcpd/normal') diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 2d416942..38789ddd 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -326,6 +327,15 @@ int main(int argc, char * argv[]) pthread_rwlock_unlock(&_ipcp->state_lock); + if (ipcp_create_r(getpid())) { + LOG_ERR("Failed to notify IRMd we are initialized."); + normal_ipcp_data_destroy(); + fmgr_fini(); + free(_ipcp); + close_logfile(); + exit(EXIT_FAILURE); + } + pthread_join(normal_data(_ipcp)->mainloop, NULL); normal_ipcp_data_destroy(); -- cgit v1.2.3