mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +00:00
LibDNS: Make DNS packet parsing fallible
Previously, a DNS packet containing an invalid name would be returned with an empty name. With this change, an error is returned if any error is encountered during parsing.
This commit is contained in:
parent
95d62822bf
commit
1793f51bc6
8 changed files with 29 additions and 40 deletions
|
@ -24,7 +24,7 @@ class Packet {
|
|||
public:
|
||||
Packet() = default;
|
||||
|
||||
static Optional<Packet> from_raw_packet(ReadonlyBytes bytes);
|
||||
static ErrorOr<Packet> from_raw_packet(ReadonlyBytes bytes);
|
||||
ErrorOr<ByteBuffer> to_byte_buffer() const;
|
||||
|
||||
bool is_query() const { return !m_query_or_response; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue