Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet PR/kern 55567



details:   https://anonhg.NetBSD.org/src/rev/73a4bcbffccb
branches:  trunk
changeset: 943816:73a4bcbffccb
user:      kardel <kardel%NetBSD.org@localhost>
date:      Fri Sep 11 09:08:47 2020 +0000

description:
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

diffstat:

 sys/netinet/tcp_input.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r b439978b0b64 -r 73a4bcbffccb sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Fri Sep 11 09:01:41 2020 +0000
+++ b/sys/netinet/tcp_input.c   Fri Sep 11 09:08:47 2020 +0000
@@ -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 @@
                         * 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



Home | Main Index | Thread Index | Old Index