summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-03-21 16:57:12 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2017-03-21 16:57:12 +0100
commit122202761b3fb09a883ca8081eb1eb4243cd484d (patch)
tree64564971f6a9545fc7404ab8933876e102a5d21c
parent1fbb83707e3a43847d36896c6cbc045a91af5ecf (diff)
parentebb8a6ce66832ba9c963f1454b5b97fe5e15bd00 (diff)
downloadouroboros-122202761b3fb09a883ca8081eb1eb4243cd484d.tar.gz
ouroboros-122202761b3fb09a883ca8081eb1eb4243cd484d.zip
Merge branch 'testing' into be
-rw-r--r--include/ouroboros/ipcp-dev.h4
-rw-r--r--src/ipcpd/local/main.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h
index 6cad9a87..89ef733b 100644
--- a/include/ouroboros/ipcp-dev.h
+++ b/include/ouroboros/ipcp-dev.h
@@ -29,8 +29,8 @@
int ipcp_create_r(pid_t api,
int result);
-int ipcp_flow_req_arr(pid_t api,
- char * dst_name,
+int ipcp_flow_req_arr(pid_t api,
+ char * dst_name,
qoscube_t cube);
int ipcp_flow_alloc_reply(int fd,
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index f025afa2..38a901c0 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -233,13 +233,19 @@ static int ipcp_local_flow_alloc(int fd,
if (ipcp_get_state() != IPCP_OPERATIONAL) {
pthread_rwlock_unlock(&ipcpi.state_lock);
- log_dbg("Won't register with non-enrolled IPCP.");
+ log_dbg("Won't allocate over non-operational IPCP.");
return -1; /* -ENOTENROLLED */
}
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;