Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/netinet Pull up following revision(s) (requested by k...



details:   https://anonhg.NetBSD.org/src/rev/15b785b5d484
branches:  netbsd-8
changeset: 938699:15b785b5d484
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 13 12:16:34 2020 +0000

description:
Pull up following revision(s) (requested by kardel in ticket #1604):

        sys/netinet/tcp_input.c: revision 1.420

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 10039b60efe6 -r 15b785b5d484 sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Sun Sep 13 12:13:13 2020 +0000
+++ b/sys/netinet/tcp_input.c   Sun Sep 13 12:16:34 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.357.4.6 2020/09/03 13:40:41 martin Exp $       */
+/*     $NetBSD: tcp_input.c,v 1.357.4.7 2020/09/13 12:16:34 martin 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.357.4.6 2020/09/03 13:40:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.357.4.7 2020/09/13 12:16:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2061,13 +2061,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