diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-04 18:20:39 +0100 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-04 18:20:39 +0100 |
commit | 0f041c04ea364326c4206b94724bf2944d3d2129 (patch) | |
tree | 4a133500b4057709c04d6bead5e321a3ffd2f142 /src/ipcpd/normal | |
parent | c9b54bcd27fe87559f82b9a1cebba9b38abf5ebc (diff) | |
download | ouroboros-0f041c04ea364326c4206b94724bf2944d3d2129.tar.gz ouroboros-0f041c04ea364326c4206b94724bf2944d3d2129.zip |
ipcpd: Revert normal IPCP state correctly
The state of the IPCP should revert to INIT when pthread_create fails
in the normal and bootstrapping procedures.
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r-- | src/ipcpd/normal/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 8d319894..8db754aa 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -187,6 +187,7 @@ static int normal_ipcp_enroll(char * dst_name) LOG_WARN("Failed to finalize flow manager."); if (ribmgr_fini()) LOG_WARN("Failed to finalize RIB manager."); + ipcp_set_state(IPCP_INIT); pthread_rwlock_unlock(&ipcpi.state_lock); LOG_ERR("Failed to create acceptor thread."); return -1; @@ -269,6 +270,7 @@ static int normal_ipcp_bootstrap(struct dif_config * conf) LOG_WARN("Failed to finalize flow manager."); if (ribmgr_fini()) LOG_WARN("Failed to finalize RIB manager."); + ipcp_set_state(IPCP_INIT); pthread_rwlock_unlock(&ipcpi.state_lock); LOG_ERR("Failed to create acceptor thread."); return -1; |