From d51155663a0a95659bd8a02a6cba51359ff416db Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 8 Jan 2016 01:11:55 +0100 Subject: 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. --- src/shared/dns-domain.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/shared') 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 */ -- cgit v1.2.3-54-g00ecf