diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-24 22:02:55 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-03-25 11:42:39 +0100 |
commit | d451f0e84b1909ca0d24a1e3c135d5ffa2d8613c (patch) | |
tree | 1b81fc95cc7753c470ed11549c7e2d32ee4132fb | |
parent | 8640566ac41447e07bb8b4e990626a17b183c80c (diff) | |
download | systemd-d451f0e84b1909ca0d24a1e3c135d5ffa2d8613c.tar.gz |
resolved: tweak sections we add answer RRs to
Previously we'd stick all answer sections RRs we acquired into
the authoritative section if we didn't find them directly answering our
question. Let's put them into additional instead. The authoritative
section should hence only include what comes from the upstream
authoritative section, and nothing else.
-rw-r--r-- | src/resolve/resolved-dns-stub.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index b6d14b9305..7cbbdc725c 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -323,27 +323,27 @@ static int dns_stub_assign_sections( if (r < 0) return r; - /* Include all RRs that originate from the answer or authority sections, and aren't listed in the + /* Include all RRs that originate from the authority sections, and aren't already listed in the * answer section, in the authority section */ r = dns_stub_collect_answer_by_section( &q->reply_authoritative, q->answer, - DNS_ANSWER_SECTION_ANSWER, + DNS_ANSWER_SECTION_AUTHORITY, q->reply_answer, NULL, edns0_do); if (r < 0) return r; + + /* Include all RRs that originate from the answer or additional sections in the additional section + * (except if already listed in the other two sections). Also add all RRs with no section marking. */ r = dns_stub_collect_answer_by_section( - &q->reply_authoritative, + &q->reply_additional, q->answer, - DNS_ANSWER_SECTION_AUTHORITY, - q->reply_answer, NULL, + DNS_ANSWER_SECTION_ANSWER, + q->reply_answer, q->reply_authoritative, edns0_do); if (r < 0) return r; - - /* Include all RRs that originate from the additional sections in the additional section (except if - * already listed in the other two sections). Also add all RRs with no section marking. */ r = dns_stub_collect_answer_by_section( &q->reply_additional, q->answer, |