Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 May 2018 18:28:30 +0300
From:      hanoh haim <hhaim.hanoh@gmail.com>
To:        freebsd-net@freebsd.org
Cc:        hhaim.hanoh@gamil.com
Subject:   TCP keepalive does not work for half-close connections
Message-ID:  <CA%2BYxBoL3DOKO7g9X0_QhamURkPRPGv69a4o5%2BJDJbUDY416ieA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi Expert,

Regarding the folwoing code,
Is there a reason that keepalive timer does not protect from half-close
socket (e.g. other side crash after this step)?

example

C    S

FIN->
  <-ACK

server crash here, the Client is not protected by keepalive

     <-FIN
 ->ACK


I think that this condition should be removed.
"tp->t_state <= TCPS_CLOSIN "


if ((tcp_always_keepalive ||
inp->inp_socket->so_options & SO_KEEPALIVE) &&
tp->t_state <= TCPS_CLOSING) {
thanks
Hanoh



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BYxBoL3DOKO7g9X0_QhamURkPRPGv69a4o5%2BJDJbUDY416ieA>