summaryrefslogtreecommitdiff
path: root/src/ipcpd/local
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/local')
-rw-r--r--src/ipcpd/local/main.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index 38a901c0..718c8d7e 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -229,6 +229,12 @@ static int ipcp_local_flow_alloc(int fd,
assert(dst_name);
+ out_fd = ipcp_flow_req_arr(getpid(), dst_name, cube);
+ if (out_fd < 0) {
+ log_dbg("Flow allocation failed.");
+ return -1;
+ }
+
pthread_rwlock_rdlock(&ipcpi.state_lock);
if (ipcp_get_state() != IPCP_OPERATIONAL) {
@@ -239,14 +245,6 @@ static int ipcp_local_flow_alloc(int fd,
pthread_rwlock_wrlock(&local_data.lock);
- out_fd = ipcp_flow_req_arr(getpid(), dst_name, cube);
- if (out_fd < 0) {
- log_dbg("Flow allocation failed.");
- pthread_rwlock_unlock(&local_data.lock);
- pthread_rwlock_unlock(&ipcpi.state_lock);
- return -1;
- }
-
local_data.in_out[fd] = out_fd;
local_data.in_out[out_fd] = fd;