race condition fix (win tun)

This commit is contained in:
jeka committed 2026-03-07 12:21:01 +03:00
1 parent 5dfd1ea5fe
commit 5d4cef0c3e
6 files changed
+32 -7

No files matched your search

+1 -1
View File
@@ -88,7 +88,7 @@ int etcp_send(struct ETCP_CONN* conn, struct ll_entry* entry) {
// Помещаем entry в очередь input normalizer
// queue_data_put забирает ownership entry
DEBUG_TRACE(DEBUG_CATEGORY_NORMALIZER, "Before put to input");
// DEBUG_TRACE(DEBUG_CATEGORY_NORMALIZER, "Before put to input");
int result = queue_data_put(pn->input, entry, 0);
DEBUG_TRACE(DEBUG_CATEGORY_NORMALIZER, "After put to input");
+2 -1
View File
@@ -273,7 +273,8 @@ DWORD WINAPI tun_read_thread_proc(LPVOID arg)
memcpy(data + 1, wintun_pkt, size);
WintunReleaseReceivePacket(session, wintun_pkt); /* сразу отдаём кольцо */
struct ll_entry* pkt = queue_entry_new_from_pool(tun->pool);
// struct ll_entry* pkt = queue_entry_new_from_pool(tun->pool);// from pool нельзя - нет thred safe (memory consistency)
struct ll_entry* pkt = queue_entry_new(0);
if (!pkt) {
u_free(data);
tun->read_errors++;