diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-02-09 17:44:58 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-02-09 17:44:58 +0000 |
commit | 0557bc02b963bab6f690b410fe937a9f487a84ba (patch) | |
tree | 31828a5eb1a646883c3f582795c8ffc7c990b35b /src/ipcpd/normal | |
parent | 275dc65b22e39654e4dfc9cbd13277e490c8dccd (diff) | |
parent | 6785ca65ab48f1a29914c1784a24009964ec4720 (diff) | |
download | ouroboros-0557bc02b963bab6f690b410fe937a9f487a84ba.tar.gz ouroboros-0557bc02b963bab6f690b410fe937a9f487a84ba.zip |
Merged in dstaesse/ouroboros/be-create_r (pull request #367)
ipcpd, lib: Report IPCP creation failure
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r-- | src/ipcpd/normal/main.c | 6 | ||||
-rw-r--r-- | src/ipcpd/normal/pol/flat.c | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 2b30dba3..b69bfe28 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -459,17 +459,20 @@ int main(int argc, if (ipcp_init(argc, argv, THIS_TYPE, &normal_ops) < 0) { log_err("Failed to create instance."); + ipcp_create_r(getpid(), -1); exit(EXIT_FAILURE); } if (irm_bind_api(getpid(), ipcpi.name)) { log_err("Failed to bind AP name."); + ipcp_create_r(getpid(), -1); ipcp_fini(); exit(EXIT_FAILURE); } if (rib_init()) { log_err("Failed to initialize RIB."); + ipcp_create_r(getpid(), -1); irm_unbind_api(getpid(), ipcpi.name); ipcp_fini(); exit(EXIT_FAILURE); @@ -479,6 +482,7 @@ int main(int argc, if (ipcp_boot() < 0) { log_err("Failed to boot IPCP."); + ipcp_create_r(getpid(), -1); rib_fini(); irm_unbind_api(getpid(), ipcpi.name); ipcp_fini(); @@ -487,7 +491,7 @@ int main(int argc, pthread_sigmask(SIG_UNBLOCK, &sigset, NULL); - if (ipcp_create_r(getpid())) { + if (ipcp_create_r(getpid(), 0)) { log_err("Failed to notify IRMd we are initialized."); ipcp_set_state(IPCP_NULL); ipcp_shutdown(); diff --git a/src/ipcpd/normal/pol/flat.c b/src/ipcpd/normal/pol/flat.c index 9ffeb5c7..61b0110c 100644 --- a/src/ipcpd/normal/pol/flat.c +++ b/src/ipcpd/normal/pol/flat.c @@ -27,6 +27,7 @@ #include <ouroboros/errno.h> #include <ouroboros/time_utils.h> #include <ouroboros/rib.h> +#include <ouroboros/utils.h> #include "ipcp.h" @@ -46,15 +47,6 @@ static void addr_name(char * name, sprintf(name, "%8x", (uint32_t) (addr)); } -#define freepp(type, ptr, len) \ - do { \ - if (len == 0) \ - break; \ - while (len > 0) \ - free(((type **) ptr)[--len]); \ - free(ptr); \ - } while (0); - static int addr_taken(char * name, char ** members, size_t len) |