Fix fast path for uni directional transfers pure ACK case: drag snd_wl2 along so only newer ACKs can update the window size. also avoids the state where snd_wl2 is eventually larger than th_ack and thus blocking the window update mechanism and the connection gets stuck for a loooong time in the zero sized send window state. see PR/kern 55567 ok thorpej@, also found in FreeBSDdiff -r1.418 -r1.419 src/sys/netinet/tcp_input.c
(kardel)
--- src/sys/netinet/tcp_input.c 2020/07/06 18:49:12 1.418
+++ src/sys/netinet/tcp_input.c 2020/09/02 15:08:46 1.419
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.418 2020/07/06 18:49:12 christos Exp $ */
+/* $NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.418 2020/07/06 18:49:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1897,6 +1897,19 @@
tp->snd_fack = tp->snd_una;
if (SEQ_LT(tp->snd_high, tp->snd_una))
tp->snd_high = tp->snd_una;
+ /*
+ * drag snd_wl2 along so only newer
+ * ACKs can update the window size.
+ * also avoids the state where snd_wl2
+ * is eventually larger than th_ack and thus
+ * blocking the window update mechanism and
+ * the connection gets stuck for a loooong
+ * time in the zero sized send window state.
+ *
+ * see PR/kern 55567
+ */
+ tp->snd_wl2 = tp->snd_una;
+
m_freem(m);
/*