summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-25 16:23:03 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-25 16:23:03 +0200
commit84f0f1a64fa2beb00abf30d00072d4f818cf9bd4 (patch)
tree32443ecbb20927b33a6becd50dc6720e4be5b722 /src/ipcpd/normal/main.c
parent830f60599a7912c89b4754e7c757f2ef9e6c00f0 (diff)
parentf7777922edd673e43fd670d3d28f052fde2ecc0a (diff)
downloadouroboros-84f0f1a64fa2beb00abf30d00072d4f818cf9bd4.tar.gz
ouroboros-84f0f1a64fa2beb00abf30d00072d4f818cf9bd4.zip
Merged in dstaesse/ouroboros/be-bugfixing (pull request #226)
ipcpd, normal: Safe handling of CDAP requests
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r--src/ipcpd/normal/main.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index a067fb83..f0fc0681 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -80,15 +80,6 @@ void ipcp_sig_handler(int sig, siginfo_t * info, void * c)
ipcp_set_state(_ipcp, IPCP_SHUTDOWN);
pthread_rwlock_unlock(&_ipcp->state_lock);
-
- if (fmgr_fini())
- LOG_ERR("Failed to finalize flow manager.");
-
- if (ribmgr_fini())
- LOG_ERR("Failed to finalize RIB manager.");
-
- if (frct_fini())
- LOG_ERR("Failed to finalize FRCT.");
}
default:
return;
@@ -247,9 +238,9 @@ void normal_ipcp_data_destroy()
if (normal_data(_ipcp)->rb != NULL)
shm_ap_rbuff_close(normal_data(_ipcp)->rb);
- pthread_rwlock_unlock(&_ipcp->state_lock);
-
ipcp_data_destroy(_ipcp->data);
+
+ pthread_rwlock_unlock(&_ipcp->state_lock);
}
int main(int argc, char * argv[])
@@ -339,6 +330,15 @@ int main(int argc, char * argv[])
pthread_join(normal_data(_ipcp)->mainloop, NULL);
+ if (fmgr_fini())
+ LOG_ERR("Failed to finalize flow manager.");
+
+ if (ribmgr_fini())
+ LOG_ERR("Failed to finalize RIB manager.");
+
+ if (frct_fini())
+ LOG_ERR("Failed to finalize FRCT.");
+
normal_ipcp_data_destroy();
free(_ipcp);
close_logfile();