diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-05 10:37:09 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-05 10:43:22 +0200 |
commit | 52cfe9ebae5707674e90d50b728b9c957ca215ee (patch) | |
tree | fb3ec67a249df449f40d561784f066424b417060 /Kernel/Net/UDPSocket.cpp | |
parent | 6347e3aa51b45c7ecc35a7dd3fb4e6252529b83e (diff) | |
download | serenity-52cfe9ebae5707674e90d50b728b9c957ca215ee.zip |
IPv4: Remove an unnecessary copy of each outgoing IPv4 payload
There's no need for send_ipv4() to take a ByteBuffer&&, the data is
immediately cooked into a packet and transmitted. Instead, just pass
it the address+length of whatever buffer we've been using locally.
The more we can reduce the pressure on kmalloc the better. :^)
Diffstat (limited to 'Kernel/Net/UDPSocket.cpp')
-rw-r--r-- | Kernel/Net/UDPSocket.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp index 2349837ba4..c3acf1261f 100644 --- a/Kernel/Net/UDPSocket.cpp +++ b/Kernel/Net/UDPSocket.cpp @@ -70,7 +70,7 @@ int UDPSocket::protocol_send(const void* data, int data_length) local_port(), peer_address().to_string().characters(), peer_port()); - adapter->send_ipv4(MACAddress(), peer_address(), IPv4Protocol::UDP, move(buffer)); + adapter->send_ipv4(MACAddress(), peer_address(), IPv4Protocol::UDP, buffer.data(), buffer.size()); return data_length; } |