Date: Thu, 20 Jan 2005 17:50:33 +0300 (MSK) From: Dmitrij Tejblum <tejblum@yandex-team.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/76504: Keep-alives doesn't work on half-closed sockets. Message-ID: <200501201450.j0KEoX6I050097@developer.yandex.ru> Resent-Message-ID: <200501201500.j0KF0emM024567@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 76504 >Category: kern >Synopsis: Keep-alives doesn't work on half-closed sockets. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 20 15:00:40 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Dmitrij Tejblum >Release: FreeBSD 5.3-STABLE i386 >Organization: >Environment: >Description: When a TCP socket is shutdown for writing, but isn't closed and isn't shutdown for reading, then keep-alives does not work on this socket. >How-To-Repeat: Set sysctl net.inet.tcp.keepintvl to several seconds, create a half-closed connection, and look with tcpdump. Half-closed connection may be create by e.g. rsh -n. >Fix: --- tcp_timer.c Mon Jan 17 15:06:36 2005 +++ tcp_timer.c Thu Jan 20 16:24:11 2005 @@ -336,7 +336,7 @@ if (tp->t_state < TCPS_ESTABLISHED) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && - tp->t_state <= TCPS_CLOSING) { + (tp->t_state <= TCPS_CLOSING || tp->t_state == TCPS_FIN_WAIT_2)) { if ((ticks - tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) goto dropit; /* >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501201450.j0KEoX6I050097>