X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fresolve%2Fresolved-dns-domain.c;h=eea73f6d5476851a1cfa8448e2782ccc7f9f0728;hp=a41052dde39eee8407436ca0fe64f0df85339b3c;hb=322345fdb9865ef2477fba8e4bdde0e1183ef505;hpb=c5ed93163e6ef51a7462aa558a7e0912b17c4951 diff --git a/src/resolve/resolved-dns-domain.c b/src/resolve/resolved-dns-domain.c index a41052dde..eea73f6d5 100644 --- a/src/resolve/resolved-dns-domain.c +++ b/src/resolve/resolved-dns-domain.c @@ -218,7 +218,7 @@ int dns_name_normalize(const char *s, char **_ret) { unsigned long dns_name_hash_func(const void *s, const uint8_t hash_key[HASH_KEY_SIZE]) { const char *p = s; - unsigned long ul = 0; + unsigned long ul = hash_key[0]; int r; assert(p); @@ -233,7 +233,7 @@ unsigned long dns_name_hash_func(const void *s, const uint8_t hash_key[HASH_KEY_ label[r] = 0; ascii_strlower(label); - ul = hash_key[0] * ul + ul + string_hash_func(label, hash_key); + ul = ul * hash_key[1] + ul + string_hash_func(label, hash_key); } return ul;