mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Answer CNAME queries correctly.
This commit is contained in:
@@ -89,6 +89,9 @@ version 2.61
|
|||||||
and the OpenStack team for the suggestion.
|
and the OpenStack team for the suggestion.
|
||||||
|
|
||||||
Updated French translation. Thanks to Gildas Le Nadan.
|
Updated French translation. Thanks to Gildas Le Nadan.
|
||||||
|
|
||||||
|
Give correct from-cache answers to explict CNAME queries.
|
||||||
|
Thanks to Rob Zwissler for spotting this.
|
||||||
|
|
||||||
|
|
||||||
version 2.60
|
version 2.60
|
||||||
|
|||||||
@@ -1639,6 +1639,23 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
} while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
|
} while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qtype == T_CNAME || qtype == T_ANY)
|
||||||
|
{
|
||||||
|
if ((crecp = cache_find_by_name(NULL, name, now, F_CNAME)) &&
|
||||||
|
(qtype == T_CNAME || (crecp->flags & (F_HOSTS | F_DHCP))))
|
||||||
|
{
|
||||||
|
ans = 1;
|
||||||
|
if (!dryrun)
|
||||||
|
{
|
||||||
|
log_query(crecp->flags, name, NULL, record_source(crecp->uid));
|
||||||
|
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
||||||
|
crec_ttl(crecp, now), &nameoffset,
|
||||||
|
T_CNAME, C_IN, "d", cache_get_name(crecp->addr.cname.cache)))
|
||||||
|
anscount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (qtype == T_MX || qtype == T_ANY)
|
if (qtype == T_MX || qtype == T_ANY)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user