mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:57:34 +00:00
LookupServer: Fix serializing name data in DNS answers
When serializing a RR of type PTR, we should use the DNS name serialization format, not a raw string.
This commit is contained in:
parent
d6f7ced4f1
commit
80f7489df0
3 changed files with 16 additions and 2 deletions
|
@ -70,6 +70,13 @@ DNSName DNSName::parse(const u8* data, size_t& offset, size_t max_offset, size_t
|
|||
}
|
||||
}
|
||||
|
||||
size_t DNSName::serialized_size() const
|
||||
{
|
||||
if (m_name.is_empty())
|
||||
return 1;
|
||||
return m_name.length() + 2;
|
||||
}
|
||||
|
||||
OutputStream& operator<<(OutputStream& stream, const DNSName& name)
|
||||
{
|
||||
auto parts = name.as_string().split_view('.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue