summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-12-24 00:13:41 +0100
committerKay Sievers <kay@vrfy.org>2013-12-24 00:13:41 +0100
commitcfb91b347db0b17fc3b14986e44dbfd1554968e6 (patch)
tree662ed12ab774128d78e9138f7fa277c37270b314 /match.c
parent98961e4cfd33a2fe6f8ac64ff2d699beeadada54 (diff)
downloadkdbus-bus-cfb91b347db0b17fc3b14986e44dbfd1554968e6.tar.gz
kdbus-bus-cfb91b347db0b17fc3b14986e44dbfd1554968e6.tar.bz2
kdbus-bus-cfb91b347db0b17fc3b14986e44dbfd1554968e6.zip
match: check for currently owned names
Diffstat (limited to 'match.c')
-rw-r--r--match.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/match.c b/match.c
index 160b09299ca..482acbba204 100644
--- a/match.c
+++ b/match.c
@@ -147,22 +147,7 @@ int kdbus_match_db_new(struct kdbus_match_db **db)
return 0;
}
-static inline
-bool kdbus_match_name(const char *haystack,
- size_t haystack_size,
- const char *needle)
-{
- size_t i;
-
- for (i = 0; i < haystack_size; i += strlen(haystack) + 1)
- if (strcmp(haystack + i, needle) == 0)
- return true;
-
- return false;
-}
-
-static inline
-bool kdbus_match_bloom(const u64 *filter, const u64 *mask,
+static bool kdbus_match_bloom(const u64 *filter, const u64 *mask,
const struct kdbus_conn *conn)
{
unsigned int i;
@@ -242,9 +227,7 @@ static bool kdbus_match_rules(const struct kdbus_match_entry *entry,
break;
case KDBUS_ITEM_NAME:
- if (!kdbus_match_name(kmsg->meta.src_names,
- kmsg->meta.src_names_len,
- r->name))
+ if (!kdbus_conn_has_name(conn_src, r->name))
return false;
break;