mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-02 09:47:03 +03:00
Revert "resolved: gracefully handle with packets with too large RR count"
This reverts commit fdfffdaf20a18a50c9a6d858359cf4af6d2f4c8b. There are multiple reports that this breaks lookups for people, and reverting this commit, even on the main branch (approx. v248-rc4), fixes the issue. https://github.com/systemd/systemd/issues/18917#issuecomment-799421587 https://bodhi.fedoraproject.org/updates/FEDORA-2021-1c1a870ceb (cherry picked from commit 7e88a9aef6e6385b0f5889bfc412e03540806085)
This commit is contained in:
parent
d44c3024b9
commit
423b1e759c
@ -2210,18 +2210,6 @@ static int dns_packet_extract_answer(DnsPacket *p, DnsAnswer **ret_answer) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (p->rindex == p->size) {
|
||||
/* If we reached the end of the packet already, but there are still more RRs
|
||||
* declared, then that's a corrupt packet. Let's accept the packet anyway, since it's
|
||||
* apparently a common bug in routers. Let's however suppress OPT support in this
|
||||
* case, so that we force the rest of the logic into lowest DNS baseline support. Or
|
||||
* to say this differently: if the DNS server doesn't even get the RR counts right,
|
||||
* it's highly unlikely it gets EDNS right. */
|
||||
log_debug("More resource records declared in packet than included, suppressing OPT.");
|
||||
bad_opt = true;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Try to reduce memory usage a bit */
|
||||
if (previous)
|
||||
dns_resource_key_reduce(&rr->key, &previous->key);
|
||||
@ -2307,10 +2295,8 @@ static int dns_packet_extract_answer(DnsPacket *p, DnsAnswer **ret_answer) {
|
||||
previous = dns_resource_record_ref(rr);
|
||||
}
|
||||
|
||||
if (bad_opt) {
|
||||
if (bad_opt)
|
||||
p->opt = dns_resource_record_unref(p->opt);
|
||||
p->opt_start = p->opt_size = SIZE_MAX;
|
||||
}
|
||||
|
||||
*ret_answer = TAKE_PTR(answer);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user