summaryrefslogtreecommitdiff
path: root/src/shared/dns-domain.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-08 01:11:55 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-11 19:39:59 +0100
commitd51155663a0a95659bd8a02a6cba51359ff416db (patch)
treef4f432b97e2743c9cabc375e651eee744f146ee0 /src/shared/dns-domain.c
parent758dd67e8d40e65f695103bb03a77afaa087c5be (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/shared/dns-domain.c')
-rw-r--r--src/shared/dns-domain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index bcfc93608c..59475115ba 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -504,6 +504,7 @@ void dns_name_hash_func(const void *s, struct siphash *state) {
ascii_strlower_n(label, r);
siphash24_compress(label, r, state);
+ siphash24_compress_byte(0, state); /* make sure foobar and foo.bar result in different hashes */
}
/* enforce that all names are terminated by the empty label */