message: allow both names and unique IDs at the same time
authorDaniel Mack <daniel@zonque.org>
Wed, 8 Oct 2014 15:36:34 +0000 (17:36 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 8 Oct 2014 15:36:34 +0000 (17:36 +0200)
Do not bail if a name item is passed while the message is addressed to
a unique ID. We'll use that message configuration in the next patch.

Signed-off-by: Daniel Mack <daniel@zonque.org>
message.c

index 83ea5ae6c68854c2351e9a8ada9c58376db59b52..3232dccf90a8d086526b2c9514aa7c6695ecfded 100644 (file)
--- a/message.c
+++ b/message.c
@@ -232,12 +232,11 @@ static int kdbus_msg_scan_items(struct kdbus_conn *conn,
        if (msg->dst_id == KDBUS_DST_ID_NAME && !has_name)
                return -EDESTADDRREQ;
 
-       /* name and ID should not be given at the same time */
-       if (msg->dst_id > KDBUS_DST_ID_NAME &&
-           msg->dst_id < KDBUS_DST_ID_BROADCAST && has_name)
-               return -EBADMSG;
-
        if (msg->dst_id == KDBUS_DST_ID_BROADCAST) {
+               /* broadcasts can't take names */
+               if (has_name)
+                       return -EBADMSG;
+
                /* broadcast messages require a bloom filter */
                if (!has_bloom)
                        return -EBADMSG;