summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-03-15 08:09:15 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-03-15 08:09:15 +0000
commitb44cdf4069f30e342dfb80ec3eef7dd5c37367d0 (patch)
treee95f8f7aebc8af0003ff5d99fc1ef9b4d93be534 /src/ipcpd
parent366fcbec4fb7de21c553f24efb977b45bf27f2e6 (diff)
parente26ddb08e8a5f37ca2caf9bd7a96c956816e96de (diff)
downloadouroboros-b44cdf4069f30e342dfb80ec3eef7dd5c37367d0.tar.gz
ouroboros-b44cdf4069f30e342dfb80ec3eef7dd5c37367d0.zip
Merged in dstaesse/ouroboros/be-fixes (pull request #401)
Be fixes
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/normal/connmgr.c7
-rw-r--r--src/ipcpd/normal/enroll.c11
2 files changed, 6 insertions, 12 deletions
diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c
index 87daeddb..c86beae8 100644
--- a/src/ipcpd/normal/connmgr.c
+++ b/src/ipcpd/normal/connmgr.c
@@ -1,7 +1,7 @@
/*
* Ouroboros - Copyright (C) 2016 - 2017
*
- * Handles the different AP connections
+ * Handles AE connections
*
* Dimitri Staessens <dimitri.staessens@ugent.be>
* Sander Vrijders <sander.vrijders@ugent.be>
@@ -285,7 +285,10 @@ int connmgr_alloc(struct ae * ae,
return -1;
}
- conn->flow_info.qs = *qs;
+ if (qs != NULL)
+ conn->flow_info.qs = *qs;
+ else
+ memset(&conn->flow_info.qs, 0, sizeof(conn->flow_info.qs));
if (flow_alloc_res(conn->flow_info.fd)) {
log_err("Flow allocation to %s failed.", dst_name);
diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c
index 4e510038..bdf55fe8 100644
--- a/src/ipcpd/normal/enroll.c
+++ b/src/ipcpd/normal/enroll.c
@@ -106,8 +106,6 @@ static void * enroll_handle(void * o)
if (oc != CDAP_READ) {
log_warn("Invalid request.");
cdap_reply_send(cdap, key, -1, NULL, 0);
- cdap_destroy(cdap);
- flow_dealloc(conn.flow_info.fd);
free(name);
continue;
}
@@ -126,14 +124,10 @@ static void * enroll_handle(void * o)
buf[1] = hton64(t.tv_nsec);
cdap_reply_send(cdap, key, 0, buf, sizeof(buf));
free(name);
- cdap_destroy(cdap);
- flow_dealloc(conn.flow_info.fd);
continue;
} else {
log_warn("Illegal read: %s.", name);
cdap_reply_send(cdap, key, -1, NULL, 0);
- cdap_destroy(cdap);
- flow_dealloc(conn.flow_info.fd);
free(name);
continue;
}
@@ -142,8 +136,6 @@ static void * enroll_handle(void * o)
if (len < 0) {
log_err("Failed to pack %s.", name);
cdap_reply_send(cdap, key, -1, NULL, 0);
- cdap_destroy(cdap);
- flow_dealloc(conn.flow_info.fd);
free(name);
continue;
}
@@ -154,8 +146,7 @@ static void * enroll_handle(void * o)
if (cdap_reply_send(cdap, key, 0, buf, len)) {
log_err("Failed to send CDAP reply.");
- cdap_destroy(cdap);
- flow_dealloc(conn.flow_info.fd);
+ free(buf);
continue;
}