summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-15 16:25:07 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-15 16:25:07 +0200
commit990ac58472300955bf4d7a380539ef049791d013 (patch)
treeb6d436026be8d4cd01c263217fcd07d96f484711
parent5fe9706b823cd441703239ece020e517d722d88c (diff)
downloadouroboros-990ac58472300955bf4d7a380539ef049791d013.tar.gz
ouroboros-990ac58472300955bf4d7a380539ef049791d013.zip
lib: allow accepting any flows
The application can call accept(fd, NULL, NULL);
-rw-r--r--src/lib/dev.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 55e4dc17..67c58702 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -249,9 +249,6 @@ int flow_accept(int fd,
irm_msg_t * recv_msg = NULL;
int cfd = -1;
- if (ap_name == NULL)
- return -1;
-
msg.code = IRM_MSG_CODE__IRM_FLOW_ACCEPT;
msg.has_pid = true;
@@ -270,12 +267,15 @@ int flow_accept(int fd,
return -1;
}
- *ap_name = strdup(recv_msg->ap_name);
- if (*ap_name == NULL) {
- irm_msg__free_unpacked(recv_msg, NULL);
- return -1;
+ if (ap_name != NULL) {
+ *ap_name = strdup(recv_msg->ap_name);
+ if (*ap_name == NULL) {
+ irm_msg__free_unpacked(recv_msg, NULL);
+ return -1;
+ }
}
+
if (ae_name != NULL) {
*ae_name = strdup(recv_msg->ae_name);
if (*ae_name == NULL) {