From 559d061d5853b63656d71e63d3f491ae9679d8ed Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 22 Oct 2014 14:05:39 +0200 Subject: [PATCH] message: allow memfds for broadcast messages As discussed on LPC. Signed-off-by: Daniel Mack --- message.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/message.c b/message.c index 65c3a26..1c5f1b0 100644 --- a/message.c +++ b/message.c @@ -128,15 +128,9 @@ static int kdbus_msg_scan_items(struct kdbus_conn *conn, bool has_fds = false; struct file *f; - KDBUS_ITEMS_FOREACH(item, msg->items, KDBUS_ITEMS_SIZE(msg, items)) { - if (item->type == KDBUS_ITEM_PAYLOAD_MEMFD) { - /* do not allow to broadcast file descriptors */ - if (msg->dst_id == KDBUS_DST_ID_BROADCAST) - return -ENOTUNIQ; - + KDBUS_ITEMS_FOREACH(item, msg->items, KDBUS_ITEMS_SIZE(msg, items)) + if (item->type == KDBUS_ITEM_PAYLOAD_MEMFD) kmsg->memfds_count++; - } - } if (kmsg->memfds_count > 0) { kmsg->memfds = kcalloc(kmsg->memfds_count, -- 2.34.1