1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

Kernel: Increase m_bytes_out only once during transmission

We were accidentally increasing m_bytes_out by the packet size and then
immediately calling send_packet(), which did the same thing as well.
This commit is contained in:
Idan Horowitz 2021-06-11 01:39:35 +03:00 committed by Andreas Kling
parent 9ee5029bc5
commit 70fc0a528c

View file

@ -42,7 +42,6 @@ void NetworkAdapter::send(const MACAddress& destination, const ARPPacket& packet
eth->set_source(mac_address());
eth->set_destination(destination);
eth->set_ether_type(EtherType::ARP);
m_bytes_out += size_in_bytes;
memcpy(eth->payload(), &packet, sizeof(ARPPacket));
send_packet({ (const u8*)eth, size_in_bytes });
}