From 54caeb1f1af20b0afc923b06bf2ae0b7a7251aeb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 9 Sep 2019 08:39:38 +0200 Subject: [PATCH] RTL8139: Fix bogus (but harmless) TX buffer index in send_raw() This was getting fixed up by the loop that chooses the next TX buffer anyway, but let's do this correctly. Fixes #522. --- Kernel/Net/RTL8139NetworkAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Net/RTL8139NetworkAdapter.cpp b/Kernel/Net/RTL8139NetworkAdapter.cpp index 84a1a286b8..5ab7282430 100644 --- a/Kernel/Net/RTL8139NetworkAdapter.cpp +++ b/Kernel/Net/RTL8139NetworkAdapter.cpp @@ -296,7 +296,7 @@ void RTL8139NetworkAdapter::send_raw(const u8* data, int length) #ifdef RTL8139_DEBUG kprintf("RTL8139NetworkAdapter: chose buffer %d @ %p\n", hw_buffer, m_tx_buffer_addr[hw_buffer]); #endif - m_tx_next_buffer = hw_buffer + 1 % 4; + m_tx_next_buffer = (hw_buffer + 1) % 4; } memcpy((void*)(m_tx_buffer_addr[hw_buffer]), data, length);