svn commit: r343661 - in head/sys/netinet: . tcp_stacks

Michael Tuexen tuexen at FreeBSD.org
Fri Feb 1 12:33:01 UTC 2019


Author: tuexen
Date: Fri Feb  1 12:33:00 2019
New Revision: 343661
URL: https://svnweb.freebsd.org/changeset/base/343661

Log:
  When handling SYN-ACK segments in the SYN-RCVD state, set tp->snd_wnd
  consistently.
  
  This inconsistency was observed when working on the bug reported in
  PR 235256, although it does not fix the reported issue. The fix for
  the PR will be a separate commit.
  
  PR:			235256
  Reviewed by:		rrs@, Richard Scheffenegger
  MFC after:		3 days
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D19033

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Fri Feb  1 12:24:56 2019	(r343660)
+++ head/sys/netinet/tcp_input.c	Fri Feb  1 12:33:00 2019	(r343661)
@@ -2385,8 +2385,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
 		if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
 			(TF_RCVD_SCALE|TF_REQ_SCALE)) {
 			tp->rcv_scale = tp->request_r_scale;
-			tp->snd_wnd = tiwin;
 		}
+		tp->snd_wnd = tiwin;
 		/*
 		 * Make transitions:
 		 *      SYN-RECEIVED  -> ESTABLISHED

Modified: head/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- head/sys/netinet/tcp_stacks/rack.c	Fri Feb  1 12:24:56 2019	(r343660)
+++ head/sys/netinet/tcp_stacks/rack.c	Fri Feb  1 12:33:00 2019	(r343661)
@@ -5433,6 +5433,7 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
 		tp->ts_recent_age = tcp_ts_getticks();
 		tp->ts_recent = to->to_tsval;
 	}
+	tp->snd_wnd = tiwin;
 	/*
 	 * If the ACK bit is off:  if in SYN-RECEIVED state or SENDSYN flag
 	 * is on (half-synchronized state), then queue data for later
@@ -5440,7 +5441,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
 	 */
 	if ((thflags & TH_ACK) == 0) {
 		if (IS_FASTOPEN(tp->t_flags)) {
-			tp->snd_wnd = tiwin;
 			cc_conn_init(tp);
 		}
 		return (rack_process_data(m, th, so, tp, drop_hdrlen, tlen,
@@ -5452,7 +5452,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
 	if ((tp->t_flags & (TF_RCVD_SCALE | TF_REQ_SCALE)) ==
 	    (TF_RCVD_SCALE | TF_REQ_SCALE)) {
 		tp->rcv_scale = tp->request_r_scale;
-		tp->snd_wnd = tiwin;
 	}
 	/*
 	 * Make transitions: SYN-RECEIVED  -> ESTABLISHED SYN-RECEIVED* ->


More information about the svn-src-head mailing list