summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-bloom.c
AgeCommit message (Collapse)Author
2015-06-10bus: fix bloom_add_prefixes() to add all required dataDavid Herrmann
Lets look at an example where we add arg0="/foo/bar/waldo" to a bloom-filter. The following strings are added: "arg0:/foo/bar/waldo" "arg0-slash-prefix:/foo/bar" "arg0-slash-prefix:/foo" Two problems arise: 1) If we match on "arg0path=/foo/bar/waldo", the dbus-spec explicitly states that equal strings are also considered prefixes. However, in the bloom-match, we can only provide a single match-filter. Therefore, we have to add "arg0-slash-prefix:/foo/bar/waldo" there, but this never occured in the bloom-mask of the message. Hence, this patch makes sure bloom_add_prefixes() adds the full path as prefix, too. 2) If we match on "arg0path=/foo/", the dbus-spec states that arg0path does prefix-matching with the trailing slash _included_, unlike path_namespace= matches, which does *not* include them. This is inconsistent, but we have to support the specs. Therefore, we must add prefixes with _and_ without trailing separators. Hence, this patch makes sure bloom_add_prefixes() adds all prefixes with the trailing slash included. The final set of strings added therefore is: "arg0:/foo/bar/waldo" "arg0-slash-prefix:/foo/bar/waldo" "arg0-slash-prefix:/foo/bar/" "arg0-slash-prefix:/foo/bar" "arg0-slash-prefix:/foo/" "arg0-slash-prefix:/foo" "arg0-slash-prefix:/"
2014-08-13bus-bloom: Fix bloom filter calculationDenis Kenzior
i is being used incorrectly. It is used to refer to the number of indexes calculated so far (out of k). However, it is also incremented when a new hash key is being used. This means that the results are inconsistent with the desired behavior described in PORTING-DBUS1 document. The expected result is that for the default values of m and k (512, 8) the 1st hash key should produce 4 indexes. The second hash key is used for the next 4 and overall 8 indexes into m are calculated. The current behavior results in 6 indexes being calculated, 4 coming from hash key 1 and 2 others from hash key 5.
2014-01-28bus: rework bloom filter logic to operate with variable bloom filterLennart Poettering
sizes and numbers of hash functions In order to make the bloom filter logic more future proof communicate bloom filter parameters from the original bus creator to the clients, and allow them to be variable within certain ranges.
2014-01-21libsystemd: split up into subdirsTom Gundersen
We still only produce on .so, but let's keep the sources separate to make things a bit less messy.