From owner-freebsd-net@freebsd.org Fri May 4 15:28:32 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A728FB0292 for ; Fri, 4 May 2018 15:28:32 +0000 (UTC) (envelope-from hhaim.hanoh@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0DE77389F for ; Fri, 4 May 2018 15:28:31 +0000 (UTC) (envelope-from hhaim.hanoh@gmail.com) Received: by mail-it0-x235.google.com with SMTP id q4-v6so3851537ite.3 for ; Fri, 04 May 2018 08:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=XrihNiXH8Y2tv+F9VbvnwmmxRF6G82F+IRFNdynsayU=; b=XXvqUxBTd0TBiakZEqrq5Ji0b1d70idyGf0cY6I+qs51jfkPBMuylHkp9gT1ooLOU/ CNttMDYWXsqAGoulL5JJw6peOExYlG+kPFVFeNpZ2ZeTd0+oCFdrGonXxYW5lfG2nVqB 18O73me/b1uHK35GhwaGNG2bh42nG5GyUQ5NCeFdg7PwxaJqaAd9RPl4O5cQdAq4ge5a gQ+56nDEb3AJ/wvJ2buYvokq8yjkGOekUCFtshlu5WRw1KNGqx5lkzx44C6tQ+LXlL3v Ws1oY6YtZpYC7uOe9C6KE0pW/RYNuEihdXL8j/fAHYRT+vXlG8Hwn4FNndeeg13smvdx +w2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=XrihNiXH8Y2tv+F9VbvnwmmxRF6G82F+IRFNdynsayU=; b=PyT4SyCpK5eZCKOTE3FyvHQ/9YhCJ8vGaYJc61ozUKQ/dDLOoq7KW9k2xkd7lflozn UeVoslIuOilVeEdMNHHVNdI0mv+y+P/gRvbg7jmLg8TWerlLizp844U+PhBPXk+7k/eo oLNhgDCQnUN3k7xhE7KeRhl8RIK52L6zL1D7Aif+IFvB4xtBWO/r77NHPTtvvNFxrW7m AdRTbxnpMDFl2fkrVfKPQq5NbC53P4cv6WIAIaFD1U9w7uSpRboLFkgYdeZx3mGYCpAw pnvxfjEoGny0Xg6kdzhSa8ZBge8xLNJNAHBuaO6h9ltnWhGr5SsYa8tn7/LGG5S98j+u 1/ig== X-Gm-Message-State: ALQs6tC+ztSqIGE8SZGnMit6orInrkMNZf2kFw8ZP/uY2MiB52HLmxEq sfP6iIeIfg06mzkDX8IVkm1uuBTeRWkzzMKH429rkYWq X-Google-Smtp-Source: AB8JxZqM4kQ8kL2/GCDhYDeii41kOvzpYzFsI4071xUFn3uS/DhmH6n/DJzpTzZkp/HIYohZ0w5MLEAFijeZbQl0pEg= X-Received: by 2002:a24:d34c:: with SMTP id n73-v6mr4728063itg.104.1525447710792; Fri, 04 May 2018 08:28:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:938e:0:0:0:0:0 with HTTP; Fri, 4 May 2018 08:28:30 -0700 (PDT) From: hanoh haim Date: Fri, 4 May 2018 18:28:30 +0300 Message-ID: Subject: TCP keepalive does not work for half-close connections To: freebsd-net@freebsd.org Cc: hhaim.hanoh@gamil.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 15:28:32 -0000 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