From 5b5249a5d63428e20c8e9f35eee3fa4cd2a965c7 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 30 May 2017 20:33:16 +0000 Subject: [PATCH] TCP: Don't increase sequence number when resending a FIN. git-svn-id: svn://kolibrios.org@6914 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/tcp_output.inc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/network/tcp_output.inc b/kernel/trunk/network/tcp_output.inc index 390f57d1f9..7a5332aa96 100644 --- a/kernel/trunk/network/tcp_output.inc +++ b/kernel/trunk/network/tcp_output.inc @@ -312,8 +312,7 @@ endl call mutex_unlock popa -; Fixme: returnvalue? - + xor eax, eax ret @@ -465,6 +464,23 @@ endl .eos: +;--------------------------------------------------- +; Dont increase sequence number when resending a FIN + + test dl, TH_FIN + jz .no_fin_retransmit + + test [eax + TCP_SOCKET.t_flags], TF_SENTFIN + jz .no_fin_retransmit + + mov ebx, [eax + TCP_SOCKET.SND_NXT] + cmp ebx, [eax + TCP_SOCKET.SND_MAX] + jne .no_fin_retransmit + + dec [eax + TCP_SOCKET.SND_NXT] + + .no_fin_retransmit: + ;---------------------------------------------------- ; Calculate the receive window. ; Dont shrink window, but avoid silly window syndrome