summaryrefslogtreecommitdiff
path: root/Kernel/Net/IPv4Socket.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-31 12:13:16 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-31 12:13:16 +0100
commit99842016349d4112018566dab411dcbb82327b77 (patch)
treefe7b35414bd4ce8e61a6368114ede6432d6eda6d /Kernel/Net/IPv4Socket.cpp
parentb00799b9ce7f9e3c0c5642796b7bfb223168684b (diff)
downloadserenity-99842016349d4112018566dab411dcbb82327b77.zip
Kernel: Use KResult a bit more in the IPv4 networking code
Diffstat (limited to 'Kernel/Net/IPv4Socket.cpp')
-rw-r--r--Kernel/Net/IPv4Socket.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp
index b53242634b..0310398f02 100644
--- a/Kernel/Net/IPv4Socket.cpp
+++ b/Kernel/Net/IPv4Socket.cpp
@@ -225,9 +225,9 @@ KResultOr<size_t> IPv4Socket::sendto(FileDescription&, const UserOrKernelBuffer&
#endif
if (type() == SOCK_RAW) {
- int err = routing_decision.adapter->send_ipv4(routing_decision.next_hop, m_peer_address, (IPv4Protocol)protocol(), data, data_length, m_ttl);
- if (err < 0)
- return KResult((ErrnoCode)-err);
+ auto result = routing_decision.adapter->send_ipv4(routing_decision.next_hop, m_peer_address, (IPv4Protocol)protocol(), data, data_length, m_ttl);
+ if (result.is_error())
+ return result;
return data_length;
}