Module Name:    src
Committed By:   kardel
Date:           Fri Sep 11 09:08:47 UTC 2020

Modified Files:
        src/sys/netinet: tcp_input.c

Log Message:
PR/kern 55567

fix the data-only fast path. RCV.UP and SND.WL1 could be left behind
on long sequences of data only packets. pull them along to avoid relative
sequence wraps.

consistent with FreeBSD

addresses second failure mode of PR/kern 55567.

pullup to netbsd-8
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.419 -r1.420 src/sys/netinet/tcp_input.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.419 src/sys/netinet/tcp_input.c:1.420
--- src/sys/netinet/tcp_input.c:1.419	Wed Sep  2 15:08:46 2020
+++ src/sys/netinet/tcp_input.c	Fri Sep 11 09:08:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.420 2020/09/11 09:08:47 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.419 2020/09/02 15:08:46 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.420 2020/09/11 09:08:47 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1949,13 +1949,25 @@ after_listen:
 			 * we have enough buffer space to take it.
 			 */
 			tp->rcv_nxt += tlen;
+
+			/*
+			 * Pull rcv_up up to prevent seq wrap relative to
+			 * rcv_nxt.
+			 */
+			tp->rcv_up = tp->rcv_nxt;
+
+			/*
+			 * Pull snd_wl1 up to prevent seq wrap relative to
+			 * th_seq.
+			 */
+			tp->snd_wl1 = th->th_seq;
+
 			tcps = TCP_STAT_GETREF();
 			tcps[TCP_STAT_PREDDAT]++;
 			tcps[TCP_STAT_RCVPACK]++;
 			tcps[TCP_STAT_RCVBYTE] += tlen;
 			TCP_STAT_PUTREF();
 			nd6_hint(tp);
-
 		/*
 		 * Automatic sizing enables the performance of large buffers
 		 * and most of the efficiency of small ones by only allocating

Reply via email to