diff options
author | Richard Scheffenegger <rscheff@FreeBSD.org> | 2020-05-21 21:26:21 +0000 |
---|---|---|
committer | Richard Scheffenegger <rscheff@FreeBSD.org> | 2020-05-21 21:26:21 +0000 |
commit | 8e0511652b1023d14eb506b47e7bc983014d9a94 (patch) | |
tree | 55f0e36f6f770d8af9e48f9a41d4c1c09a67a5ab /sys/netinet/tcp_stacks/rack.c | |
parent | 6e16d87751d14df6c72e2c710d49ad530b574998 (diff) | |
download | src-8e0511652b1023d14eb506b47e7bc983014d9a94.tar.gz src-8e0511652b1023d14eb506b47e7bc983014d9a94.zip |
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.
Reviewed by: tuexen (mentor)
Approved by: tuexen (mentor)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23371
Notes
Notes:
svn path=/head/; revision=361346
Diffstat (limited to 'sys/netinet/tcp_stacks/rack.c')
-rw-r--r-- | sys/netinet/tcp_stacks/rack.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index cf2abb548c4a..5103ead115db 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -11082,17 +11082,20 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, (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) && |