mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Add missing EDNS0 section.
EDNS0 section missing in replies to EDNS0-containing queries where answer generated from --local=/<domain>/
This commit is contained in:
@@ -45,6 +45,10 @@ version 2.80
|
|||||||
Fix crash on startup with a --synth-domain which has no prefix.
|
Fix crash on startup with a --synth-domain which has no prefix.
|
||||||
Introduced in 2.79. Thanks to Andreas Engel for the bug report.
|
Introduced in 2.79. Thanks to Andreas Engel for the bug report.
|
||||||
|
|
||||||
|
Fix missing EDNS0 section in some replies generated by local
|
||||||
|
DNS configuration which confused systemd-resolvd. Thanks to
|
||||||
|
Steve Dodd for characterising the problem.
|
||||||
|
|
||||||
|
|
||||||
version 2.79
|
version 2.79
|
||||||
Fix parsing of CNAME arguments, which are confused by extra spaces.
|
Fix parsing of CNAME arguments, which are confused by extra spaces.
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
|
|||||||
void *hash = &crc;
|
void *hash = &crc;
|
||||||
#endif
|
#endif
|
||||||
unsigned int gotname = extract_request(header, plen, daemon->namebuff, NULL);
|
unsigned int gotname = extract_request(header, plen, daemon->namebuff, NULL);
|
||||||
|
unsigned char *oph = find_pseudoheader(header, plen, NULL, NULL, NULL, NULL);
|
||||||
(void)do_bit;
|
(void)do_bit;
|
||||||
|
|
||||||
/* may be no servers available. */
|
/* may be no servers available. */
|
||||||
@@ -399,7 +399,6 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
|
|||||||
struct server *firstsentto = start;
|
struct server *firstsentto = start;
|
||||||
int subnet, forwarded = 0;
|
int subnet, forwarded = 0;
|
||||||
size_t edns0_len;
|
size_t edns0_len;
|
||||||
unsigned char *oph = find_pseudoheader(header, plen, NULL, NULL, NULL, NULL);
|
|
||||||
unsigned char *pheader;
|
unsigned char *pheader;
|
||||||
|
|
||||||
/* If a query is retried, use the log_id for the retry when logging the answer. */
|
/* If a query is retried, use the log_id for the retry when logging the answer. */
|
||||||
@@ -554,6 +553,8 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
|
|||||||
if (udpfd != -1)
|
if (udpfd != -1)
|
||||||
{
|
{
|
||||||
plen = setup_reply(header, plen, addrp, flags, daemon->local_ttl);
|
plen = setup_reply(header, plen, addrp, flags, daemon->local_ttl);
|
||||||
|
if (oph)
|
||||||
|
plen = add_pseudoheader(header, plen, ((unsigned char *) header) + PACKETSZ, daemon->edns_pktsz, 0, NULL, 0, do_bit, 0);
|
||||||
send_from(udpfd, option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND), (char *)header, plen, udpaddr, dst_addr, dst_iface);
|
send_from(udpfd, option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND), (char *)header, plen, udpaddr, dst_addr, dst_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2104,7 +2105,11 @@ unsigned char *tcp_request(int confd, time_t now,
|
|||||||
|
|
||||||
/* In case of local answer or no connections made. */
|
/* In case of local answer or no connections made. */
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
|
{
|
||||||
m = setup_reply(header, (unsigned int)size, addrp, flags, daemon->local_ttl);
|
m = setup_reply(header, (unsigned int)size, addrp, flags, daemon->local_ttl);
|
||||||
|
if (have_pseudoheader)
|
||||||
|
m = add_pseudoheader(header, m, ((unsigned char *) header) + 65536, daemon->edns_pktsz, 0, NULL, 0, do_bit, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user