summaryrefslogtreecommitdiff
path: root/src/irmd
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2017-02-09 16:49:56 +0100
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2017-02-09 18:11:48 +0100
commit6785ca65ab48f1a29914c1784a24009964ec4720 (patch)
tree31828a5eb1a646883c3f582795c8ffc7c990b35b /src/irmd
parent275dc65b22e39654e4dfc9cbd13277e490c8dccd (diff)
downloadouroboros-6785ca65ab48f1a29914c1784a24009964ec4720.tar.gz
ouroboros-6785ca65ab48f1a29914c1784a24009964ec4720.zip
ipcpd, lib: Report IPCP creation failure
The IPCP will now respond with an ipcp_create_r message when it fails, informing the IRMd. Also adds some const qualifiers in the public headers and fixes some formatting in dev.c.
Diffstat (limited to 'src/irmd')
-rw-r--r--src/irmd/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index c029b4cf..74cb8359 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -303,10 +303,14 @@ static pid_t create_ipcp(char * name,
return api->pid;
}
-static int create_ipcp_r(pid_t api)
+static int create_ipcp_r(pid_t api,
+ int result)
{
struct list_head * pos = NULL;
+ if (result != 0)
+ return result;
+
pthread_rwlock_rdlock(&irmd->state_lock);
pthread_rwlock_rdlock(&irmd->reg_lock);
@@ -1821,7 +1825,7 @@ void * mainloop(void * o)
break;
case IRM_MSG_CODE__IPCP_CREATE_R:
ret_msg.has_result = true;
- ret_msg.result = create_ipcp_r(msg->api);
+ ret_msg.result = create_ipcp_r(msg->api, msg->result);
break;
case IRM_MSG_CODE__IRM_DESTROY_IPCP:
ret_msg.has_result = true;