summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-24 22:17:38 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-25 08:31:34 +0200
commit7147313663c738c87ef98b8a9f965c7f6dc185a0 (patch)
tree82ac0dfa7da1e82dcfd5e79eb6069b770cde3bf7 /src/ipcpd/normal
parentc85dac656cfea758ed582508d61a5d9eb6bd7bf9 (diff)
downloadouroboros-7147313663c738c87ef98b8a9f965c7f6dc185a0.tar.gz
ouroboros-7147313663c738c87ef98b8a9f965c7f6dc185a0.zip
ipcpd, normal: Fix bad lock
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r--src/ipcpd/normal/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index 9479b806..a067fb83 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -136,14 +136,13 @@ 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;
}
- pthread_rwlock_unlock(&_ipcp->state_lock);
-
if (ipcp_wait_state(_ipcp, IPCP_ENROLLED, &timeout) == -ETIMEDOUT) {
LOG_ERR("Enrollment timed out.");
return -1;
@@ -156,6 +155,8 @@ static int normal_ipcp_enroll(char * dif_name)
return -1;
}
+ pthread_rwlock_unlock(&_ipcp->state_lock);
+
return 0;
}