]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: do not hit CNAME or DNAME entry in NODATA cache (#9836)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 13 Aug 2018 05:32:33 +0000 (14:32 +0900)
committerGitHub <noreply@github.com>
Mon, 13 Aug 2018 05:32:33 +0000 (14:32 +0900)
Fixes #9833.

src/resolve/resolved-dns-cache.c

index 95e9e072c1c4ab10d075e7f7daed9c437d5395cb..99dec28a4667de7baf7d08f7b4da837395d07c40 100644 (file)
@@ -783,7 +783,7 @@ static DnsCacheItem *dns_cache_get_by_key_follow_cname_dname_nsec(DnsCache *c, D
         if (dns_type_may_redirect(k->type)) {
                 /* Check if we have a CNAME record instead */
                 i = hashmap_get(c->by_key, &DNS_RESOURCE_KEY_CONST(k->class, DNS_TYPE_CNAME, n));
-                if (i)
+                if (i && i->type != DNS_CACHE_NODATA)
                         return i;
 
                 /* OK, let's look for cached DNAME records. */
@@ -792,7 +792,7 @@ static DnsCacheItem *dns_cache_get_by_key_follow_cname_dname_nsec(DnsCache *c, D
                                 return NULL;
 
                         i = hashmap_get(c->by_key, &DNS_RESOURCE_KEY_CONST(k->class, DNS_TYPE_DNAME, n));
-                        if (i)
+                        if (i && i->type != DNS_CACHE_NODATA)
                                 return i;
 
                         /* Jump one label ahead */