]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: use dns_name_parent() where appropriate
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Dec 2015 18:15:34 +0000 (19:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Dec 2015 18:15:34 +0000 (19:15 +0100)
src/resolve/resolved-dns-cache.c

index df397e1ddd8162ab812d566cc262bae3a5be0e26..65eff7fda6d1be69ef33f7675752461baab95e6d 100644 (file)
@@ -598,8 +598,6 @@ static DnsCacheItem *dns_cache_get_by_key_follow_cname_dname_nsec(DnsCache *c, D
 
                 /* OK, let's look for cached DNAME records. */
                 for (;;) {
-                        char label[DNS_LABEL_MAX];
-
                         if (isempty(n))
                                 return NULL;
 
@@ -608,13 +606,13 @@ static DnsCacheItem *dns_cache_get_by_key_follow_cname_dname_nsec(DnsCache *c, D
                                 return i;
 
                         /* Jump one label ahead */
-                        r = dns_label_unescape(&n, label, sizeof(label));
+                        r = dns_name_parent(&n);
                         if (r <= 0)
                                 return NULL;
                 }
         }
 
-        if (k-> type != DNS_TYPE_NSEC) {
+        if (k->type != DNS_TYPE_NSEC) {
                 /* Check if we have an NSEC record instead for the name. */
                 i = hashmap_get(c->by_key, &DNS_RESOURCE_KEY_CONST(k->class, DNS_TYPE_NSEC, n));
                 if (i)