From a105ce8fd876f5bde67e311cb42d4cddc3aba3f1 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Thu, 19 Jul 2012 13:17:11 +0000 Subject: [PATCH] Fixed bug with TCP_close git-svn-id: svn://kolibrios.org@2882 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/ARP.inc | 1 + kernel/branches/net/network/socket.inc | 2 -- kernel/branches/net/network/tcp_input.inc | 14 +++++++------- kernel/branches/net/network/tcp_subr.inc | 2 -- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/kernel/branches/net/network/ARP.inc b/kernel/branches/net/network/ARP.inc index 257297f9b4..40497210c6 100644 --- a/kernel/branches/net/network/ARP.inc +++ b/kernel/branches/net/network/ARP.inc @@ -511,6 +511,7 @@ ARP_IP_to_MAC: ret .invalid: + DEBUGF 1,"ARP entry has no valid mapping!\n" mov eax, -1 ret diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index 9bf2364ce8..972e66fccf 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -1525,8 +1525,6 @@ SOCKET_free: call mutex_lock popa - DEBUGF 1, "SOCKET_free: freeing socket..\n" - cmp [eax + SOCKET.Domain], AF_INET4 jnz .no_tcp diff --git a/kernel/branches/net/network/tcp_input.inc b/kernel/branches/net/network/tcp_input.inc index ca1545cc95..091a37d4e0 100644 --- a/kernel/branches/net/network/tcp_input.inc +++ b/kernel/branches/net/network/tcp_input.inc @@ -815,7 +815,7 @@ align 4 test [edx + TCP_header.Flags], TH_RST jz .rst_skip - DEBUGF 1,"Got an RST flag" + DEBUGF 1,"Got an RST flag\n" mov eax, [ebx + TCP_SOCKET.t_state] shl eax, 2 @@ -835,21 +835,21 @@ align 4 dd .rst_close ;TCPS_TIMED_WAIT .econnrefused: - DEBUGF 1,"Connection refused" + DEBUGF 1,"Connection refused\n" mov [ebx + SOCKET.errorcode], ECONNREFUSED jmp .close .econnreset: - DEBUGF 1,"Connection reset" + DEBUGF 1,"Connection reset\n" mov [ebx + SOCKET.errorcode], ECONNRESET - .close: - DEBUGF 1,"Closing connection" + .close: + DEBUGF 1,"Closing connection\n" mov [ebx + TCP_SOCKET.t_state], TCPS_CLOSED - ;;; TODO: update stats + ;;; TODO: update stats (tcp drops) mov eax, ebx call TCP_close jmp .drop @@ -1200,7 +1200,7 @@ align 4 mov eax, ebx - call TCP_close + call TCP_disconnect jmp .drop diff --git a/kernel/branches/net/network/tcp_subr.inc b/kernel/branches/net/network/tcp_subr.inc index dd5aec4ea8..a44f20f4fa 100644 --- a/kernel/branches/net/network/tcp_subr.inc +++ b/kernel/branches/net/network/tcp_subr.inc @@ -183,10 +183,8 @@ TCP_close: ;;; TODO: update RTT and mean deviation ;;; TODO: update slow start threshold -;;; TODO: release connection resources call SOCKET_is_disconnected - call SOCKET_free ret