summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-03-21 18:01:43 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2017-03-21 18:01:43 +0100
commit1d0e634a651f234c3942c6b82164470fa2432058 (patch)
tree6977229f9148774a4338c489134207ab8b0f5c9f /src/ipcpd/normal/main.c
parent122202761b3fb09a883ca8081eb1eb4243cd484d (diff)
downloadouroboros-1d0e634a651f234c3942c6b82164470fa2432058.tar.gz
ouroboros-1d0e634a651f234c3942c6b82164470fa2432058.zip
ipcpd: normal: Several bugfixes
These solve several bugfixes in the normal.
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r--src/ipcpd/normal/main.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index 7acf3046..82381ba7 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -151,7 +151,8 @@ static int boot_components(void)
return -1;
}
- if (fmgr_start()) {
+ if (fmgr_init()) {
+ log_err("Failed to initialize flow manager component.");
frct_fini();
dir_fini();
ribmgr_fini();
@@ -160,9 +161,19 @@ static int boot_components(void)
return -1;
}
+ if (fmgr_start()) {
+ fmgr_fini();
+ frct_fini();
+ dir_fini();
+ ribmgr_fini();
+ addr_auth_fini();
+ log_err("Failed to start flow manager.");
+ return -1;
+ }
if (enroll_start()) {
fmgr_stop();
+ fmgr_fini();
frct_fini();
dir_fini();
ribmgr_fini();
@@ -177,6 +188,7 @@ static int boot_components(void)
ipcp_set_state(IPCP_INIT);
enroll_stop();
fmgr_stop();
+ fmgr_fini();
frct_fini();
dir_fini();
ribmgr_fini();
@@ -198,6 +210,8 @@ void shutdown_components(void)
fmgr_stop();
+ fmgr_fini();
+
dir_fini();
ribmgr_fini();
@@ -439,23 +453,11 @@ int main(int argc,
exit(EXIT_FAILURE);
}
- if (fmgr_init()) {
- log_err("Failed to initialize flow manager component.");
- ipcp_create_r(getpid(), -1);
- enroll_fini();
- connmgr_fini();
- rib_fini();
- irm_unbind_api(getpid(), ipcpi.name);
- ipcp_fini();
- exit(EXIT_FAILURE);
- }
-
pthread_sigmask(SIG_BLOCK, &sigset, NULL);
if (ipcp_boot() < 0) {
log_err("Failed to boot IPCP.");
ipcp_create_r(getpid(), -1);
- fmgr_fini();
enroll_fini();
connmgr_fini();
rib_fini();
@@ -470,7 +472,6 @@ int main(int argc,
log_err("Failed to notify IRMd we are initialized.");
ipcp_set_state(IPCP_NULL);
ipcp_shutdown();
- fmgr_fini();
enroll_fini();
connmgr_fini();
rib_fini();
@@ -484,8 +485,6 @@ int main(int argc,
if (ipcp_get_state() == IPCP_SHUTDOWN)
shutdown_components();
- fmgr_fini();
-
enroll_fini();
connmgr_fini();