[systemd-commits] src/libsystemd-bus

Daniel Mack zonque at kemper.freedesktop.org
Fri Nov 29 07:27:58 PST 2013


 src/libsystemd-bus/bus-kernel.c |    3 +++
 src/libsystemd-bus/kdbus.h      |    2 ++
 2 files changed, 5 insertions(+)

New commits:
commit c58dea190c4cc66330942ccb7a9d485ff45504d3
Author: Daniel Mack <zonque at gmail.com>
Date:   Fri Nov 29 16:24:40 2013 +0100

    libsystemd-bus: copy over kdbus provided 128-bit bus id
    
    kdbus now copies the bus unique id back to userspace in the hello
    ioctl(). Use these bytes to set the server id of the sd_bus.

diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 959392a..d2fcfd7 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -357,6 +357,9 @@ int bus_kernel_take_fd(sd_bus *b) {
         b->bus_client = true;
         b->can_fds = !!(hello.conn_flags & KDBUS_HELLO_ACCEPT_FD);
 
+        /* the kernel told us the UUID of the underlying bus */
+        memcpy(b->server_id.bytes, hello.id128, sizeof(b->server_id.bytes));
+
         r = bus_start_running(b);
         if (r < 0)
                 return r;
diff --git a/src/libsystemd-bus/kdbus.h b/src/libsystemd-bus/kdbus.h
index 52085b9..c69c1fe 100644
--- a/src/libsystemd-bus/kdbus.h
+++ b/src/libsystemd-bus/kdbus.h
@@ -276,6 +276,8 @@ struct kdbus_cmd_hello {
 	__u64 bloom_size;	/* The bloom filter size chosen by the
 				 * bus owner */
 	__u64 pool_size;	/* maximum size of pool buffer */
+	__u8 id128[16];		/* the unique id of the bus */
+
 	struct kdbus_item items[0];
 };
 



More information about the systemd-commits mailing list