From a396aff3da031a8516355aa9a7c690f2ff58954b Mon Sep 17 00:00:00 2001 From: ashmew2 Date: Tue, 17 Oct 2017 19:43:14 +0000 Subject: [PATCH] Fix TCP window size in tcp_respond git-svn-id: svn://kolibrios.org@7098 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/tcp_subr.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/trunk/network/tcp_subr.inc b/kernel/trunk/network/tcp_subr.inc index 0cf2b3e073..cb499c2eb6 100644 --- a/kernel/trunk/network/tcp_subr.inc +++ b/kernel/trunk/network/tcp_subr.inc @@ -303,7 +303,15 @@ tcp_respond: stosb mov al, cl stosb - mov eax, [esi + TCP_SOCKET.RCV_WND] + mov eax, SOCKET_BUFFER_SIZE + sub eax, [esi + STREAM_SOCKET.rcv.size] + cmp eax, TCP_max_win + jbe .lessthanmax + mov eax, TCP_max_win +.lessthanmax: + mov cl, [esi + TCP_SOCKET.RCV_SCALE] + shr eax, cl + xchg al, ah stosw ; window xor eax, eax