From 70fc0a528c8123e268139f5a1891d00b96ff4c0f Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Fri, 11 Jun 2021 01:39:35 +0300 Subject: [PATCH] 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. --- Kernel/Net/NetworkAdapter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Kernel/Net/NetworkAdapter.cpp b/Kernel/Net/NetworkAdapter.cpp index c386b7362c..89c39fbaac 100644 --- a/Kernel/Net/NetworkAdapter.cpp +++ b/Kernel/Net/NetworkAdapter.cpp @@ -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 }); }