|
Zbigniew Jędrzejewski-Szmek |
65248c |
From 9ac47d37a59142a66ac13f58bef197117ff53141 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
Date: Wed, 24 Mar 2021 11:42:39 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
Subject: [PATCH] Revert "resolved: gracefully handle with packets with too
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
large RR count"
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
This reverts commit 18674159ebbf622a9e6e5a45cc36b38f74dae315.
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
There are multiple reports that this breaks lookups for people, and reverting
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
this commit, even on the main branch (approx. v248-rc4), fixes the issue.
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
https://github.com/systemd/systemd/issues/18917#issuecomment-799421587
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
https://bodhi.fedoraproject.org/updates/FEDORA-2021-1c1a870ceb
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
---
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
src/resolve/resolved-dns-packet.c | 16 +---------------
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
1 file changed, 1 insertion(+), 15 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
index abc978ab83..15c8123f6a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
--- a/src/resolve/resolved-dns-packet.c
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
+++ b/src/resolve/resolved-dns-packet.c
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
@@ -2271,18 +2271,6 @@ static int dns_packet_extract_answer(DnsPacket *p, DnsAnswer **ret_answer) {
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
bool cache_flush = false;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
size_t start;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- if (p->rindex == p->size) {
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- /* If we reached the end of the packet already, but there are still more RRs
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- * declared, then that's a corrupt packet. Let's accept the packet anyway, since it's
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- * apparently a common bug in routers. Let's however suppress OPT support in this
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- * case, so that we force the rest of the logic into lowest DNS baseline support. Or
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- * to say this differently: if the DNS server doesn't even get the RR counts right,
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- * it's highly unlikely it gets EDNS right. */
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- log_debug("More resource records declared in packet than included, suppressing OPT.");
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- bad_opt = true;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- break;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
-
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
r = dns_packet_read_rr(p, &rr, &cache_flush, &start;;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
@@ -2382,10 +2370,8 @@ static int dns_packet_extract_answer(DnsPacket *p, DnsAnswer **ret_answer) {
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
previous = dns_resource_record_ref(rr);
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
}
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- if (bad_opt) {
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
+ if (bad_opt)
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
p->opt = dns_resource_record_unref(p->opt);
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- p->opt_start = p->opt_size = SIZE_MAX;
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
*ret_answer = TAKE_PTR(answer);
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
--
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
2.30.2
|
|
Zbigniew Jędrzejewski-Szmek |
65248c |
|