summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-12-03 17:42:57 +0100
committerKay Sievers <kay@vrfy.org>2013-12-03 17:42:57 +0100
commit5de527009ed7f3dd65fc74f761e5d40b58813f2d (patch)
treef4a7608100242a1aa5beab2e4e0671dcc765659e
parentf4596f94c38bfcf70d8dd7bc286e059c2849f0a5 (diff)
downloadkdbus-bus-5de527009ed7f3dd65fc74f761e5d40b58813f2d.tar.gz
kdbus-bus-5de527009ed7f3dd65fc74f761e5d40b58813f2d.tar.bz2
kdbus-bus-5de527009ed7f3dd65fc74f761e5d40b58813f2d.zip
do not return starter connections with unique ids list
-rw-r--r--names.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/names.c b/names.c
index 3bd5451f68e..7fe6579dee6 100644
--- a/names.c
+++ b/names.c
@@ -617,7 +617,7 @@ int kdbus_cmd_name_list(struct kdbus_name_registry *reg,
{
struct kdbus_cmd_name_list *cmd_list;
struct kdbus_name_list list = {};
- struct kdbus_name_entry *name_entry = NULL, *e;
+ struct kdbus_name_entry *name_entry = NULL;
struct kdbus_bus *bus = conn->ep->bus;
size_t size, name_len;
u64 tmp;
@@ -676,6 +676,8 @@ int kdbus_cmd_name_list(struct kdbus_name_registry *reg,
size = sizeof(struct kdbus_name_list);
if (flags & KDBUS_NAME_LIST_NAMES) {
+ struct kdbus_name_entry *e;
+
hash_for_each(reg->entries_hash, tmp, e, hentry) {
if (entry_list_omit(e, flags))
continue;
@@ -695,8 +697,12 @@ int kdbus_cmd_name_list(struct kdbus_name_registry *reg,
struct kdbus_conn *c;
int i;
- hash_for_each(bus->conn_hash, i, c, hentry)
+ hash_for_each(bus->conn_hash, i, c, hentry) {
+ if (c->flags & KDBUS_HELLO_STARTER)
+ continue;
+
size += KDBUS_ALIGN8(sizeof(struct kdbus_cmd_name));
+ }
}
ret = kdbus_pool_alloc(conn->pool, size, &off);
@@ -715,6 +721,8 @@ int kdbus_cmd_name_list(struct kdbus_name_registry *reg,
pos += sizeof(struct kdbus_name_list);
if (flags & KDBUS_NAME_LIST_NAMES) {
+ struct kdbus_name_entry *e;
+
/* copy names */
hash_for_each(reg->entries_hash, tmp, e, hentry) {
struct kdbus_cmd_name cmd_name = {};
@@ -776,6 +784,9 @@ int kdbus_cmd_name_list(struct kdbus_name_registry *reg,
hash_for_each(bus->conn_hash, i, c, hentry) {
struct kdbus_cmd_name cmd_name = {};
+ if (c->flags & KDBUS_HELLO_STARTER)
+ continue;
+
cmd_name.size = sizeof(struct kdbus_cmd_name);
cmd_name.id = c->id;
cmd_name.flags = c->flags;