diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-08 01:11:55 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-11 19:39:59 +0100 |
commit | d51155663a0a95659bd8a02a6cba51359ff416db (patch) | |
tree | f4f432b97e2743c9cabc375e651eee744f146ee0 /src/resolve | |
parent | 758dd67e8d40e65f695103bb03a77afaa087c5be (diff) |
shared: make sure foo.bar and foobar result in different domain name hashes
This also introduces a new macro siphash24_compress_byte() which is useful to add a single byte into the hash stream,
and ports one user over to it.
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index 993f0c4e97..dbf840157f 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -1120,8 +1120,9 @@ static void dns_resource_record_hash_func(const void *i, struct siphash *state) LIST_FOREACH(items, j, rr->txt.items) { siphash24_compress(j->data, j->length, state); - /* Add an extra NUL byte, so that "a" followed by "b" doesn't result in the same hash as "ab" followed by "". */ - siphash24_compress((const uint8_t[]) { 0 }, 1, state); + /* Add an extra NUL byte, so that "a" followed by "b" doesn't result in the same hash as "ab" + * followed by "". */ + siphash24_compress_byte(0, state); } break; } |