summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-07 20:07:44 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-11 19:39:59 +0100
commitd12315a4c883af968ec5ffb36a5aed3dc43b7ce7 (patch)
tree62a337174a9df0582d573bce38d800510ebb32fd /src
parent509eddd202f2d0962379defe1c483d5c9bd482c8 (diff)
shared: simplify dns_name_hash_func() end of name detection
Diffstat (limited to 'src')
-rw-r--r--src/shared/dns-domain.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index 729508e6a5..bcfc93608c 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -486,13 +486,15 @@ void dns_name_hash_func(const void *s, struct siphash *state) {
assert(p);
- while (*p) {
+ for (;;) {
char label[DNS_LABEL_MAX+1];
int k;
r = dns_label_unescape(&p, label, sizeof(label));
if (r < 0)
break;
+ if (r == 0)
+ break;
k = dns_label_undo_idna(label, r, label, sizeof(label));
if (k < 0)
@@ -500,9 +502,6 @@ void dns_name_hash_func(const void *s, struct siphash *state) {
if (k > 0)
r = k;
- if (r == 0)
- break;
-
ascii_strlower_n(label, r);
siphash24_compress(label, r, state);
}