From 990ac58472300955bf4d7a380539ef049791d013 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sun, 15 May 2016 16:25:07 +0200 Subject: lib: allow accepting any flows The application can call accept(fd, NULL, NULL); --- src/lib/dev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/lib') 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) { -- cgit v1.2.3