From: Lennart Poettering Date: Mon, 15 Mar 2021 21:15:18 +0000 (+0100) Subject: resolved: match CNAME replies to right question X-Git-Tag: v248-rc4~10^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7c0291c104cdd9d5ae2fe3c5855273bbadae13e;p=thirdparty%2Fsystemd.git resolved: match CNAME replies to right question Previously by mistake we'd always match every single reply we get in a CNAME chain to the original question from the stub client. That's broken, we need to test it against the CNAME query we are currently looking at. The effect of this incorrect matching was that we'd assign the RRs to the wrong section since we'd assume they'd be auxiliary answers instead of primary answers. Fixes: #18972 --- diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index f8d4767e536..b6d14b9305e 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -761,7 +761,7 @@ static void dns_stub_query_complete(DnsQuery *q) { * and keep adding all RRs in the CNAME chain. */ r = dns_stub_assign_sections( q, - q->request_packet->question, + dns_query_question_for_protocol(q, DNS_PROTOCOL_DNS), dns_stub_reply_with_edns0_do(q)); if (r < 0) { log_debug_errno(r, "Failed to assign sections: %m");