From c6ebf89b8f14431200a0d45497b3dfcd2c36707a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 22 Feb 2021 22:51:32 +0100 Subject: [PATCH] resolved: update comment in DNS stub code a bit There's no "answer_auxiliary" object anymore, it's all one "answer" object, and we have per-item flags that tell us which section things are from, i.e. from the main answer section, or the additional or authoritative ones. --- src/resolve/resolved-dns-stub.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index 8f3349cbce7..b6e66f7f67f 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -246,17 +246,17 @@ static int dns_stub_assign_sections( assert(q); assert(question); - /* Let's assign the 'answer' and 'answer_auxiliary' RRs we collected to their respective sections in - * the reply datagram. We try to reproduce a section assignment similar to what the upstream DNS - * server responded to us. We use the DNS_ANSWER_SECTION_xyz flags to match things up, which is where - * the original upstream's packet section assignment is stored in the DnsAnswer object. Not all RRs - * in the 'answer' and 'answer_auxiliary' objects come with section information though (for example, - * because they were synthesized locally, and not from a DNS packet). To deal with that we extend the - * assignment logic a bit: anything from the 'answer' object that directly matches the original - * question is always put in the ANSWER section, regardless if it carries section info, or what that - * section info says. Then, anything from the 'answer' and 'answer_auxiliary' objects that is from - * the ANSWER or AUTHORITY sections, and wasn't already added to the ANSWER section is placed in the - * AUTHORITY section. Everything else from either object is added to the ADDITIONAL section. */ + /* Let's assign the 'answer' RRs we collected to their respective sections in the reply datagram. We + * try to reproduce a section assignment similar to what the upstream DNS server responded to us. We + * use the DNS_ANSWER_SECTION_xyz flags to match things up, which is where the original upstream's + * packet section assignment is stored in the DnsAnswer object. Not all RRs in the 'answer' objects + * come with section information though (for example, because they were synthesized locally, and not + * from a DNS packet). To deal with that we extend the assignment logic a bit: anything from the + * 'answer' object that directly matches the original question is always put in the ANSWER section, + * regardless if it carries section info, or what that section info says. Then, anything from the + * 'answer' objects that is from the ANSWER or AUTHORITY sections, and wasn't already added to the + * ANSWER section is placed in the AUTHORITY section. Everything else from either object is added to + * the ADDITIONAL section. */ /* Include all RRs that directly answer the question in the answer section */ r = dns_stub_collect_answer_by_question(