1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 21:45:09 +00:00

Kernel: Implement is_zero for RoutingDecision

This commit is contained in:
Conrad Pankoff 2019-08-29 11:18:38 +10:00 committed by Andreas Kling
parent 302d521485
commit b15a7c435f
5 changed files with 11 additions and 4 deletions

View file

@ -64,7 +64,7 @@ int UDPSocket::protocol_receive(const KBuffer& packet_buffer, void* buffer, size
int UDPSocket::protocol_send(const void* data, int data_length)
{
auto routing_decision = route_to(peer_address(), local_address());
if (!routing_decision.adapter)
if (routing_decision.is_zero())
return -EHOSTUNREACH;
auto buffer = ByteBuffer::create_zeroed(sizeof(UDPPacket) + data_length);
auto& udp_packet = *(UDPPacket*)(buffer.pointer());