summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-30 12:06:51 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-30 12:06:51 +0100
commit1c6f278677707c6c38636ffac9d90e5a494f5cfb (patch)
tree439dcefbc86ca58a419d885400d3c9b918a6b1ec /Userland/Services
parent489d413fc7b6e401dae348625aa3f6a520aba0c5 (diff)
downloadserenity-1c6f278677707c6c38636ffac9d90e5a494f5cfb.zip
LookupServer: Unbreak reverse DNS lookups
We were ignoring everything but A records in DNS responses. This broke reverse lookups which obviously want the PTR records. Fix this by filtering on the requested record type instead of always A.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/LookupServer/LookupServer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp
index 338f76034d..238f8387ab 100644
--- a/Userland/Services/LookupServer/LookupServer.cpp
+++ b/Userland/Services/LookupServer/LookupServer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -263,7 +263,7 @@ Vector<String> LookupServer::lookup(const String& hostname, const String& namese
Vector<String, 8> responses;
Vector<DNSAnswer, 8> cacheable_answers;
for (auto& answer : response.answers()) {
- if (answer.type() != T_A)
+ if (answer.type() != record_type)
continue;
responses.append(answer.record_data());
if (!answer.has_expired())