Broadcast is one way, we should not care for receivers or their errors.
Currently we may return an error on custom endpoints if the last
receiver is not authorized to see name's of the sender. Even if we
have signaled all previous receivers, if we fail for the last one we may
return an error.
Improve this by just ignoring this type of error. We hide non-fatal
errors, and we return an error only if kdbus_meta_append() fails since
it can not recover. kdbus_meta_append() fails with -ENOMEM, its logic
can perhaps be improved later to have at least a nofail version where we
can recover.
And from D-Bus spec:
"Errors
Messages of type ERROR are most commonly replies to a METHOD_CALL, but
may be returned in reply to any kind of message. The message bus for
example will return an ERROR in reply to a signal emission if the bus
does not have enough memory to send the signal. "
So take this shortcut here, and hide non-fatal errors.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
kdbus_conn_entry_insert(conn_dst, conn_src, kmsg, NULL);
}
+ /* Hide non-fatal errors when doing broadcast */
+ ret = 0;
+
exit_unlock:
up_read(&bus->conn_rwlock);
return ret;