mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Make locally generated truncated answers consistent.
process_reply() is no longer doing this.
This commit is contained in:
@@ -868,7 +868,12 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
|
|||||||
|
|
||||||
/* truncation */
|
/* truncation */
|
||||||
if (trunc)
|
if (trunc)
|
||||||
header->hb3 |= HB3_TC;
|
{
|
||||||
|
header->hb3 |= HB3_TC;
|
||||||
|
if (!(ansp = skip_questions(header, qlen)))
|
||||||
|
return 0; /* bad packet */
|
||||||
|
anscount = authcount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((auth || local_query) && nxdomain)
|
if ((auth || local_query) && nxdomain)
|
||||||
SET_RCODE(header, NXDOMAIN);
|
SET_RCODE(header, NXDOMAIN);
|
||||||
|
|||||||
@@ -444,7 +444,13 @@ size_t make_local_answer(int flags, int gotname, size_t size, struct dns_header
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (trunc)
|
if (trunc)
|
||||||
header->hb3 |= HB3_TC;
|
{
|
||||||
|
header->hb3 |= HB3_TC;
|
||||||
|
if (!(p = skip_questions(header, size)))
|
||||||
|
return 0; /* bad packet */
|
||||||
|
anscount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
header->ancount = htons(anscount);
|
header->ancount = htons(anscount);
|
||||||
|
|
||||||
return p - (unsigned char *)header;
|
return p - (unsigned char *)header;
|
||||||
|
|||||||
@@ -2327,14 +2327,20 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
|
|
||||||
/* truncation */
|
/* truncation */
|
||||||
if (trunc)
|
if (trunc)
|
||||||
header->hb3 |= HB3_TC;
|
{
|
||||||
|
header->hb3 |= HB3_TC;
|
||||||
|
if (!(ansp = skip_questions(header, qlen)))
|
||||||
|
return 0; /* bad packet */
|
||||||
|
anscount = nscount = addncount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (nxdomain)
|
if (nxdomain)
|
||||||
SET_RCODE(header, NXDOMAIN);
|
SET_RCODE(header, NXDOMAIN);
|
||||||
else if (notimp)
|
else if (notimp)
|
||||||
SET_RCODE(header, NOTIMP);
|
SET_RCODE(header, NOTIMP);
|
||||||
else
|
else
|
||||||
SET_RCODE(header, NOERROR); /* no error */
|
SET_RCODE(header, NOERROR); /* no error */
|
||||||
|
|
||||||
header->ancount = htons(anscount);
|
header->ancount = htons(anscount);
|
||||||
header->nscount = htons(nscount);
|
header->nscount = htons(nscount);
|
||||||
header->arcount = htons(addncount);
|
header->arcount = htons(addncount);
|
||||||
|
|||||||
Reference in New Issue
Block a user