mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:47:35 +00:00
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.
This commit is contained in:
parent
489d413fc7
commit
1c6f278677
1 changed files with 2 additions and 2 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue