diff options
author | Kay Sievers <kay@vrfy.org> | 2014-01-20 10:44:37 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-01-20 10:44:37 +0100 |
commit | 548f8ac69b41f6f2169240143df1106cafd62ba4 (patch) | |
tree | 03b4220cc00d9b159dabc172985a5663043dff03 /bus.c | |
parent | 9f4d09d9b2ca3f59bee01115829324214632f5df (diff) | |
download | kdbus-bus-548f8ac69b41f6f2169240143df1106cafd62ba4.tar.gz kdbus-bus-548f8ac69b41f6f2169240143df1106cafd62ba4.tar.bz2 kdbus-bus-548f8ac69b41f6f2169240143df1106cafd62ba4.zip |
use the kernel's generate_random_uuid()
Diffstat (limited to 'bus.c')
-rw-r--r-- | bus.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -41,10 +41,12 @@ bool kdbus_bus_uid_is_privileged(const struct kdbus_bus *bus) /** * kdbus_bus_ref() - increase the reference counter of a kdbus_bus - * @bus: The bus to unref + * @bus: The bus to reference * * Every user of a bus, except for its creator, must add a reference to the * kdbus_bus using this function. + * + * Return: the bus itself */ struct kdbus_bus *kdbus_bus_ref(struct kdbus_bus *bus) { @@ -215,16 +217,8 @@ int kdbus_bus_new(struct kdbus_ns *ns, INIT_LIST_HEAD(&b->monitors_list); atomic64_set(&b->conn_seq_last, 0); - /* generate unique ID for this bus */ - get_random_bytes(b->id128, sizeof(b->id128)); - - /* Set UUID version to 4 --- truly random generation */ - b->id128[6] &= 0x0f; - b->id128[6] |= 0x40; - - /* Set the UUID variant to DCE */ - b->id128[8] &= 0x3f; - b->id128[8] |= 0x80; + /* generate unique bus id */ + generate_random_uuid(b->id128); b->name = kstrdup(name, GFP_KERNEL); if (!b->name) { |