summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-07-28 17:23:42 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-01 11:12:14 +0200
commitcf719963be2e42026012e152ae49f4c764dd9b4f (patch)
tree102b5d165aa246fa601cd565646db2ddb7e6d0b0 /src/ipcpd/normal/main.c
parent0fdc2c081b63cc3ca38bd97703c113245075aa18 (diff)
downloadouroboros-cf719963be2e42026012e152ae49f4c764dd9b4f.tar.gz
ouroboros-cf719963be2e42026012e152ae49f4c764dd9b4f.zip
ipcpd: normal: Allow initiating enrollment
This will add more functionality for enrolling two normal IPCPs with each other. Some bugs were fixed in CDAP. Now on enrolling, an IPCP will send a START message to the other IPCP. Next step is syncing the RIBs.
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r--src/ipcpd/normal/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index 54ebd674..57fb72df 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -80,14 +80,14 @@ void ipcp_sig_handler(int sig, siginfo_t * info, void * c)
pthread_cancel(normal_data(_ipcp)->mainloop);
+ 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.");
-
- if (fmgr_fini())
- LOG_ERR("Failed to finalize flow manager.");
}
default:
return;
@@ -138,15 +138,15 @@ static int normal_ipcp_enroll(char * dif_name)
return -1; /* -ENOTINIT */
}
+ pthread_rwlock_unlock(&_ipcp->state_lock);
+
if (fmgr_mgmt_flow(dif_name)) {
pthread_rwlock_unlock(&_ipcp->state_lock);
LOG_ERR("Failed to establish management flow.");
return -1;
}
- _ipcp->state = IPCP_ENROLLED;
-
- pthread_rwlock_unlock(&_ipcp->state_lock);
+ /* FIXME: Wait until state changed to ENROLLED */
return 0;
}