svn commit: r361841 - in stable/12/sys/netinet: . tcp_stacks
Richard Scheffenegger
rscheff at FreeBSD.org
Fri Jun 5 18:00:37 UTC 2020
Author: rscheff
Date: Fri Jun 5 18:00:36 2020
New Revision: 361841
URL: https://svnweb.freebsd.org/changeset/base/361841
Log:
MFC r361346: Retain only mutually supported TCP options after simultaneous SYN
When receiving a parallel SYN in SYN-SENT state, remove all the
options only we supported locally before sending the SYN,ACK.
This addresses a consistency issue on parallel opens.
Also, on such a parallel open, the stack could be coaxed into
running with timestamps enabled, even if administratively disabled.
This does NOT contain the merge of the change to BBR since at this
time that code does not exist in stable/12, and there is no plan to
merge BBR(v1) to stable/12.
Reviewed by: tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23371
Modified:
stable/12/sys/netinet/tcp_input.c
stable/12/sys/netinet/tcp_stacks/rack.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/netinet/tcp_input.c
==============================================================================
--- stable/12/sys/netinet/tcp_input.c Fri Jun 5 17:00:38 2020 (r361840)
+++ stable/12/sys/netinet/tcp_input.c Fri Jun 5 18:00:36 2020 (r361841)
@@ -1667,17 +1667,20 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;
tp->snd_scale = to.to_wscale;
- }
+ } else
+ tp->t_flags &= ~TF_REQ_SCALE;
/*
* Initial send window. It will be updated with
* the next incoming segment to the scaled value.
*/
tp->snd_wnd = th->th_win;
- if (to.to_flags & TOF_TS) {
+ if ((to.to_flags & TOF_TS) &&
+ (tp->t_flags & TF_REQ_TSTMP)) {
tp->t_flags |= TF_RCVD_TSTMP;
tp->ts_recent = to.to_tsval;
tp->ts_recent_age = tcp_ts_getticks();
- }
+ } else
+ tp->t_flags &= ~TF_REQ_TSTMP;
if (to.to_flags & TOF_MSS)
tcp_mss(tp, to.to_mss);
if ((tp->t_flags & TF_SACK_PERMIT) &&
Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- stable/12/sys/netinet/tcp_stacks/rack.c Fri Jun 5 17:00:38 2020 (r361840)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Fri Jun 5 18:00:36 2020 (r361841)
@@ -6754,17 +6754,20 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th
(tp->t_flags & TF_REQ_SCALE)) {
tp->t_flags |= TF_RCVD_SCALE;
tp->snd_scale = to.to_wscale;
- }
+ } else
+ tp->t_flags &= ~TF_REQ_SCALE;
/*
* Initial send window. It will be updated with the
* next incoming segment to the scaled value.
*/
tp->snd_wnd = th->th_win;
- if (to.to_flags & TOF_TS) {
+ if ((to.to_flags & TOF_TS) &&
+ (tp->t_flags & TF_REQ_TSTMP)) {
tp->t_flags |= TF_RCVD_TSTMP;
tp->ts_recent = to.to_tsval;
tp->ts_recent_age = cts;
- }
+ } else
+ tp->t_flags &= ~TF_REQ_TSTMP;
if (to.to_flags & TOF_MSS)
tcp_mss(tp, to.to_mss);
if ((tp->t_flags & TF_SACK_PERMIT) &&
More information about the svn-src-stable
mailing list