summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-03-21 17:14:50 +0000
committerdimitri staessens <[email protected]>2017-03-21 17:14:50 +0000
commit411f2fba77388ba8b2258bcb5380152460f8e8e8 (patch)
tree6977229f9148774a4338c489134207ab8b0f5c9f /src/ipcpd/normal
parent122202761b3fb09a883ca8081eb1eb4243cd484d (diff)
parent1d0e634a651f234c3942c6b82164470fa2432058 (diff)
downloadouroboros-411f2fba77388ba8b2258bcb5380152460f8e8e8.tar.gz
ouroboros-411f2fba77388ba8b2258bcb5380152460f8e8e8.zip
Merged in sandervrijders/ouroboros/be-fixes (pull request #409)
ipcpd: normal: Several bugfixes
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r--src/ipcpd/normal/fmgr.c1
-rw-r--r--src/ipcpd/normal/main.c31
-rw-r--r--src/ipcpd/normal/pol/complete.c2
-rw-r--r--src/ipcpd/normal/routing.c5
4 files changed, 20 insertions, 19 deletions
diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c
index 790b34dd..e78dd2d6 100644
--- a/src/ipcpd/normal/fmgr.c
+++ b/src/ipcpd/normal/fmgr.c
@@ -399,7 +399,6 @@ int fmgr_start(void)
fmgr.gam = gam_create(pg, fmgr.nbs, fmgr.ae);
if (fmgr.gam == NULL) {
log_err("Failed to init dt graph adjacency manager.");
- nbs_unreg_notifier(fmgr.nbs, &fmgr.nb_notifier);
return -1;
}
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();
diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c
index 1f3f6031..635b573b 100644
--- a/src/ipcpd/normal/pol/complete.c
+++ b/src/ipcpd/normal/pol/complete.c
@@ -131,6 +131,8 @@ void * complete_create(struct nbs * nbs,
allocator, (void *) complete))
return NULL;
+ pthread_join(complete->allocator, NULL);
+
if (pthread_create(&complete->listener, NULL,
listener, (void *) complete))
return NULL;
diff --git a/src/ipcpd/normal/routing.c b/src/ipcpd/normal/routing.c
index 0b82b70d..211becb4 100644
--- a/src/ipcpd/normal/routing.c
+++ b/src/ipcpd/normal/routing.c
@@ -97,9 +97,10 @@ static int routing_neighbor_event(enum nb_event event,
size_t len;
uint8_t * data;
- sprintf(fso_name, "%" PRIx64 "-%" PRIx64,
+ path[0] = '\0';
+ sprintf(fso_name, "%" PRIu64 "-%" PRIu64,
ipcpi.dt_addr, conn.conn_info.addr);
- rib_path_append(rib_path_append(path, ROUTING_PATH), fso_name);
+ rib_path_append(rib_path_append(path, ROUTING_NAME), fso_name);
switch (event) {
case NEIGHBOR_ADDED: