mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
Kernel: Use KResult a bit more in the IPv4 networking code
This commit is contained in:
parent
b00799b9ce
commit
9984201634
7 changed files with 23 additions and 21 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue