LookupServer: Only pass A record responses to clients

This works around an issue where we'd try responding to a LookupServer
client with an empty CNAME record.
This commit is contained in:
Andreas Kling 2020-05-03 14:18:53 +02:00
parent 82d83f0fe1
commit 3c0ca04ad3
Notes: sideshowbarker 2024-07-19 07:01:15 +09:00

View file

@ -243,6 +243,8 @@ Vector<String> LookupServer::lookup(const String& hostname, bool& did_timeout, u
Vector<String, 8> responses;
Vector<DNSAnswer, 8> cacheable_answers;
for (auto& answer : response.answers()) {
if (answer.type() != T_A)
continue;
responses.append(answer.record_data());
if (!answer.has_expired())
cacheable_answers.append(answer);