mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Tweak packet-reduction code going from TCP->UDP.
This commit is contained in:
@@ -2143,11 +2143,18 @@ int tcp_from_udp(time_t now, int status, struct dns_header *header, ssize_t *ple
|
||||
|
||||
if (n >= daemon->edns_pktsz)
|
||||
{
|
||||
new_header->ancount = htons(0);
|
||||
/* still too bug, strip optional sections and try again. */
|
||||
new_header->nscount = htons(0);
|
||||
new_header->arcount = htons(0);
|
||||
n = resize_packet(header, n, NULL, 0);
|
||||
new_status = STAT_TRUNCATED;
|
||||
n = resize_packet(new_header, n, NULL, 0);
|
||||
if (n >= daemon->edns_pktsz)
|
||||
{
|
||||
/* truncating the packet will break the answers, so remove them too
|
||||
and mark the reply as truncated. */
|
||||
new_header->ancount = htons(0);
|
||||
n = resize_packet(new_header, n, NULL, 0);
|
||||
new_status = STAT_TRUNCATED;
|
||||
}
|
||||
}
|
||||
|
||||
/* return the stripped or truncated reply. */
|
||||
|
||||
Reference in New Issue
Block a user