bus: catch up with kdbus changes

This commit is contained in:
Kay Sievers 2013-12-18 21:16:35 +01:00
parent 3e8a51eae6
commit ec76ec1fde
3 changed files with 16 additions and 9 deletions

View file

@ -636,7 +636,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
case KDBUS_ITEM_PAYLOAD_OFF:
if (!h) {
h = (struct bus_header *)((uint8_t *)bus->kdbus_buffer + d->vec.offset);
h = (struct bus_header *)((uint8_t *)k + d->vec.offset);
if (!bus_header_is_complete(h, d->vec.size))
return -EBADMSG;
@ -721,11 +721,11 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
if (idx >= begin_body) {
if (!part->is_zero)
part->data = (uint8_t *)bus->kdbus_buffer + d->vec.offset;
part->data = (uint8_t *)k + d->vec.offset;
part->size = d->vec.size;
} else {
if (!part->is_zero)
part->data = (uint8_t *)bus->kdbus_buffer + d->vec.offset + (begin_body - idx);
part->data = (uint8_t *)k + d->vec.offset + (begin_body - idx);
part->size = d->vec.size - (begin_body - idx);
}

View file

@ -45,10 +45,8 @@ struct kdbus_notify_id_change {
/**
* struct kdbus_notify_name_change - name registry change message
* @old_id: Former owner of a name
* @new_id: New owner of a name
* @old_flags: flags from KDBUS_NAME_* the name entry used to have
* @new_flags: flags from KDBUS_NAME_* the name entry has now
* @old: ID and flags of former owner of a name
* @new: ID and flags of new owner of a name
* @name: Well-known name
*
* Sent from kernel to userspace when the owner or activator of
@ -119,7 +117,8 @@ struct kdbus_timestamp {
* struct kdbus_vec - I/O vector for kdbus payload items
* @size: The size of the vector
* @address: Memory address for memory addresses
* @offset: Offset in the in-message payload memory
* @offset: Offset in the in-message payload memory,
* relative to the message head
*
* Attached to:
* KDBUS_ITEM_PAYLOAD_VEC
@ -195,7 +194,7 @@ struct kdbus_policy {
/**
* enum kdbus_item_type - item types to chain data in a list
* @KDBUS_ITEM_PAYLOAD_VEC: Vector to data
* @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset in the pool
* @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head
* @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd
* @KDBUS_ITEM_FDS: Attached file descriptors
* @KDBUS_ITEM_BLOOM: For broadcasts, carries bloom filter

View file

@ -122,6 +122,14 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c
else
return NULL;
/*
* We do not support subscribing to uevents if no instance of udev
* is running. Uevents would otherwise broadcast the processing data
* of the host into containers, which is not acceptable. Containers
* will currently just not get any uevents.
*/
udev_monitor = udev_monitor_new(udev);
if (udev_monitor == NULL)
return NULL;