Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/b406cd456a3c
branches:  netbsd-9
changeset: 1001987:b406cd456a3c
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 13 12:18:16 2020 +0000

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

        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 41ff84031fc4 -r b406cd456a3c sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Sun Sep 13 12:11:07 2020 +0000
+++ b/sys/netinet/tcp_input.c   Sun Sep 13 12:18:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.414.2.3 2020/09/03 13:38:29 martin Exp $       */
+/*     $NetBSD: tcp_input.c,v 1.414.2.4 2020/09/13 12:18:16 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.414.2.3 2020/09/03 13:38:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.414.2.4 2020/09/13 12:18:16 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1948,13 +1948,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