Skip to content

Commit

Permalink
resolve: do not hit CNAME or DNAME entry in NODATA cache (systemd#9836)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwata committed Aug 13, 2018
1 parent 5d3bab7 commit 3740146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resolve/resolved-dns-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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 */
Expand Down

0 comments on commit 3740146

Please sign in to comment.