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. :^)
This commit is contained in:
Andreas Kling 2019-08-05 10:37:09 +02:00
commit 52cfe9ebae
Notes: sideshowbarker 2024-07-19 12:52:55 +09:00
6 changed files with 9 additions and 9 deletions

View file

@ -27,7 +27,7 @@ public:
void set_ipv4_address(const IPv4Address&);
void send(const MACAddress&, const ARPPacket&);
void send_ipv4(const MACAddress&, const IPv4Address&, IPv4Protocol, ByteBuffer&& payload);
void send_ipv4(const MACAddress&, const IPv4Address&, IPv4Protocol, const u8* payload, size_t payload_size);
RefPtr<KBuffer> dequeue_packet();