From e7106d6be22d46caca34ebc4b52670047ddca91f Mon Sep 17 00:00:00 2001 From: Hiren Panchasara Date: Fri, 26 Aug 2016 17:48:54 +0000 Subject: [PATCH] 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 --- sys/netinet/tcp_fsm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h index 61fd0c1f8a28..5423e1f19267 100644 --- a/sys/netinet/tcp_fsm.h +++ b/sys/netinet/tcp_fsm.h @@ -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 /*