From owner-svn-src-all@freebsd.org Fri Aug 26 17:48:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFF3BB75EA2; Fri, 26 Aug 2016 17:48:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2E9F6C5; Fri, 26 Aug 2016 17:48:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QHmsK3021310; Fri, 26 Aug 2016 17:48:54 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QHmsS2021309; Fri, 26 Aug 2016 17:48:54 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201608261748.u7QHmsS2021309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 26 Aug 2016 17:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304855 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 17:48:56 -0000 Author: hiren Date: Fri Aug 26 17:48:54 2016 New Revision: 304855 URL: https://svnweb.freebsd.org/changeset/base/304855 Log: Update TCPS_HAVERCVDFIN() macro to correctly include all states a connection can be in after receiving a FIN. FWIW, NetBSD has this change for quite some time. This has been tested at Netflix and Limelight in production traffic. Reported by: Sam Kumar on transport@ Reviewed by: rrs MFC after: 4 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D7475 Modified: head/sys/netinet/tcp_fsm.h Modified: head/sys/netinet/tcp_fsm.h ============================================================================== --- head/sys/netinet/tcp_fsm.h Fri Aug 26 17:38:13 2016 (r304854) +++ head/sys/netinet/tcp_fsm.h Fri Aug 26 17:48:54 2016 (r304855) @@ -73,7 +73,8 @@ #define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) #define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED) -#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) +#define TCPS_HAVERCVDFIN(s) \ + ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2)) #ifdef TCPOUTFLAGS /*