summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/DHCPClient/DHCPv4Client.cpp3
-rw-r--r--Userland/Services/LookupServer/DNSServer.cpp2
-rw-r--r--Userland/Services/LookupServer/MulticastDNS.cpp6
3 files changed, 7 insertions, 4 deletions
diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp
index 0542c780a1..8d2d4c4231 100644
--- a/Userland/Services/DHCPClient/DHCPv4Client.cpp
+++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp
@@ -122,7 +122,8 @@ DHCPv4Client::DHCPv4Client(Vector<DeprecatedString> interfaces_with_dhcp_enabled
{
m_server = Core::UDPServer::construct(this);
m_server->on_ready_to_receive = [this] {
- auto buffer = m_server->receive(sizeof(DHCPv4Packet));
+ // TODO: we need to handle possible errors here somehow
+ auto buffer = MUST(m_server->receive(sizeof(DHCPv4Packet)));
dbgln_if(DHCPV4CLIENT_DEBUG, "Received {} bytes", buffer.size());
if (buffer.size() < sizeof(DHCPv4Packet) - DHCPV4_OPTION_FIELD_MAX_LENGTH + 1 || buffer.size() > sizeof(DHCPv4Packet)) {
dbgln("we expected {}-{} bytes, this is a bad packet", sizeof(DHCPv4Packet) - DHCPV4_OPTION_FIELD_MAX_LENGTH + 1, sizeof(DHCPv4Packet));
diff --git a/Userland/Services/LookupServer/DNSServer.cpp b/Userland/Services/LookupServer/DNSServer.cpp
index 8e73fe617c..0ef59a97b9 100644
--- a/Userland/Services/LookupServer/DNSServer.cpp
+++ b/Userland/Services/LookupServer/DNSServer.cpp
@@ -28,7 +28,7 @@ DNSServer::DNSServer(Object* parent)
ErrorOr<void> DNSServer::handle_client()
{
sockaddr_in client_address;
- auto buffer = receive(1024, client_address);
+ auto buffer = TRY(receive(1024, client_address));
auto optional_request = Packet::from_raw_packet(buffer.data(), buffer.size());
if (!optional_request.has_value()) {
dbgln("Got an invalid DNS packet");
diff --git a/Userland/Services/LookupServer/MulticastDNS.cpp b/Userland/Services/LookupServer/MulticastDNS.cpp
index b6cfbabe9f..f806c6a6c4 100644
--- a/Userland/Services/LookupServer/MulticastDNS.cpp
+++ b/Userland/Services/LookupServer/MulticastDNS.cpp
@@ -51,7 +51,8 @@ MulticastDNS::MulticastDNS(Object* parent)
void MulticastDNS::handle_packet()
{
- auto buffer = receive(1024);
+ // TODO: propagate the error somehow
+ auto buffer = MUST(receive(1024));
auto optional_packet = Packet::from_raw_packet(buffer.data(), buffer.size());
if (!optional_packet.has_value()) {
dbgln("Got an invalid mDNS packet");
@@ -167,7 +168,8 @@ Vector<Answer> MulticastDNS::lookup(Name const& name, RecordType record_type)
return {};
}
- auto buffer = receive(1024);
+ // TODO: propagate the error somehow
+ auto buffer = MUST(receive(1024));
if (buffer.is_empty())
return {};
auto optional_packet = Packet::from_raw_packet(buffer.data(), buffer.size());