mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix CNAME botch in auth code, also set RA flag for local queries.
This commit is contained in:
11
src/auth.c
11
src/auth.c
@@ -394,7 +394,7 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
|
|||||||
}
|
}
|
||||||
found = 1;
|
found = 1;
|
||||||
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
||||||
daemon->auth_ttl, NULL,
|
daemon->auth_ttl, &nameoffset,
|
||||||
T_CNAME, C_IN, "d", name))
|
T_CNAME, C_IN, "d", name))
|
||||||
anscount++;
|
anscount++;
|
||||||
|
|
||||||
@@ -782,8 +782,17 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
|
|||||||
/* done all questions, set up header and return length of result */
|
/* done all questions, set up header and return length of result */
|
||||||
/* clear authoritative and truncated flags, set QR flag */
|
/* clear authoritative and truncated flags, set QR flag */
|
||||||
header->hb3 = (header->hb3 & ~(HB3_AA | HB3_TC)) | HB3_QR;
|
header->hb3 = (header->hb3 & ~(HB3_AA | HB3_TC)) | HB3_QR;
|
||||||
|
|
||||||
|
if (local_query)
|
||||||
|
{
|
||||||
|
/* set RA flag */
|
||||||
|
header->hb4 |= HB4_RA;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* clear RA flag */
|
/* clear RA flag */
|
||||||
header->hb4 &= ~HB4_RA;
|
header->hb4 &= ~HB4_RA;
|
||||||
|
}
|
||||||
|
|
||||||
/* authoritive */
|
/* authoritive */
|
||||||
if (auth)
|
if (auth)
|
||||||
|
|||||||
Reference in New Issue
Block a user