mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
New CNAME code shouldn't spin on CNAME loops.
This commit is contained in:
@@ -1352,6 +1352,8 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
|
|
||||||
for (q = ntohs(header->qdcount); q != 0; q--)
|
for (q = ntohs(header->qdcount); q != 0; q--)
|
||||||
{
|
{
|
||||||
|
int count = 255; /* catch loops */
|
||||||
|
|
||||||
/* save pointer to name for copying into answers */
|
/* save pointer to name for copying into answers */
|
||||||
nameoffset = p - (unsigned char *)header;
|
nameoffset = p - (unsigned char *)header;
|
||||||
|
|
||||||
@@ -1364,7 +1366,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
|
|
||||||
ans = 0; /* have we answered this question */
|
ans = 0; /* have we answered this question */
|
||||||
|
|
||||||
while ((crecp = cache_find_by_name(NULL, name, now, F_CNAME)))
|
while (--count != 0 && (crecp = cache_find_by_name(NULL, name, now, F_CNAME)))
|
||||||
{
|
{
|
||||||
char *cname_target = cache_get_cname_target(crecp);
|
char *cname_target = cache_get_cname_target(crecp);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user