From 2beb55bd3aa61c809bf7b31058bdc0d4b1493f5d Mon Sep 17 00:00:00 2001 From: tsdima Date: Fri, 27 Nov 2009 19:49:15 +0000 Subject: [PATCH] fix: reset connection by peer git-svn-id: svn://kolibrios.org@1288 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/eth_drv/drivers/3c59x.inc | 8 ++++---- kernel/trunk/network/socket.inc | 2 ++ kernel/trunk/network/tcp.inc | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/kernel/trunk/network/eth_drv/drivers/3c59x.inc b/kernel/trunk/network/eth_drv/drivers/3c59x.inc index f978b13c4c..a61d8297a1 100644 --- a/kernel/trunk/network/eth_drv/drivers/3c59x.inc +++ b/kernel/trunk/network/eth_drv/drivers/3c59x.inc @@ -2134,10 +2134,10 @@ e3c59x_boomerang_transmit: @@: ; calculate mov ebx, ecx - test byte [e3c59x_has_hwcksm], 0xff - jz @f -;;; or ebx, (1 shl 26) ; set AddTcpChecksum -@@: + ;test byte [e3c59x_has_hwcksm], 0xff + ;jz @f + ;or ebx, (1 shl 26) ; set AddTcpChecksum +;@@: or ebx, 0x8000 ; transmission complete notification or ecx, 0x80000000 ; last fragment ; program DPD diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index 2d22043958..37e2b8b532 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -584,6 +584,8 @@ local sockAddr dd ? je .destroy_tcb cmp [ebx + SOCKET.TCBState], TCB_SYN_SENT je .destroy_tcb + cmp [ebx + SOCKET.TCBState], TCB_CLOSED + je .destroy_tcb ; Now construct the response, and queue for sending by IP mov eax, EMPTY_QUEUE diff --git a/kernel/trunk/network/tcp.inc b/kernel/trunk/network/tcp.inc index 0c7ce6ae4a..ae01e2ba42 100644 --- a/kernel/trunk/network/tcp.inc +++ b/kernel/trunk/network/tcp.inc @@ -888,7 +888,7 @@ proc stateTCB_ESTABLISHED stdcall, sockAddr:DWORD jne .exit ; Did we receive a FIN or RST? - test [edx + 20 + TCP_PACKET.Flags], TH_FIN + test [edx + 20 + TCP_PACKET.Flags], TH_FIN+TH_RST jz .check_ack ; It was a fin or reset. @@ -922,6 +922,10 @@ proc stateTCB_ESTABLISHED stdcall, sockAddr:DWORD @@: ; Send an ACK to that fin, and enter closewait state mov [ebx + SOCKET.TCBState], TCB_CLOSE_WAIT + test [edx + 20 + TCP_PACKET.Flags], TH_RST + je @f + mov [ebx + SOCKET.TCBState], TCB_CLOSED + @@: call signal_network_event lea esi, [ebx + SOCKET.RCV_NXT] mov eax, [esi] ; save original