projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
509eddd
)
shared: simplify dns_name_hash_func() end of name detection
author
Lennart Poettering
<lennart@poettering.net>
Thu, 7 Jan 2016 19:07:44 +0000
(20:07 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 11 Jan 2016 18:39:59 +0000
(19:39 +0100)
src/shared/dns-domain.c
patch
|
blob
|
history
diff --git
a/src/shared/dns-domain.c
b/src/shared/dns-domain.c
index
729508e
..
bcfc936
100644
(file)
--- 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);
}