From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:21:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13AE556B906; Thu, 25 Feb 2021 18:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dmh1S72TVz57lG; Thu, 25 Feb 2021 18:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C261C2C1; Thu, 25 Feb 2021 18:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PIL0uE078841; Thu, 25 Feb 2021 18:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIL060078840; Thu, 25 Feb 2021 18:21:00 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:21:00 GMT Message-Id: <202102251821.11PIL060078840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 2593f858d7d0 - main - A TCP server has to take into consideration, if TCP_NOOPT is preventing the negotiation of TCP features. This affects most TCP options but adherance to RFC7323 with the timestamp option will prevent a session from getting established. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2593f858d7d078efa85f78f20b6bfa0931cc1dc5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2021 18:21:01 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=2593f858d7d078efa85f78f20b6bfa0931cc1dc5 commit 2593f858d7d078efa85f78f20b6bfa0931cc1dc5 Author: Richard Scheffenegger AuthorDate: 2021-02-25 18:10:55 +0000 Commit: Richard Scheffenegger CommitDate: 2021-02-25 18:12:20 +0000 A TCP server has to take into consideration, if TCP_NOOPT is preventing the negotiation of TCP features. This affects most TCP options but adherance to RFC7323 with the timestamp option will prevent a session from getting established. PR: 253576 Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28652 --- sys/netinet/tcp_input.c | 12 ++++++++---- sys/netinet/tcp_syncache.c | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index bbc93a93810c..6338b7491a7f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1644,7 +1644,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, TCPSTAT_INC(tcps_ecn_shs); } if ((to.to_flags & TOF_SCALE) && - (tp->t_flags & TF_REQ_SCALE)) { + (tp->t_flags & TF_REQ_SCALE) && + !(tp->t_flags & TF_NOOPT)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; } else @@ -1655,7 +1656,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, */ tp->snd_wnd = th->th_win; if ((to.to_flags & TOF_TS) && - (tp->t_flags & TF_REQ_TSTMP)) { + (tp->t_flags & TF_REQ_TSTMP) && + !(tp->t_flags & TF_NOOPT)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_ts_getticks(); @@ -1664,10 +1666,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && - (to.to_flags & TOF_SACKPERM) == 0) + (!(to.to_flags & TOF_SACKPERM) || + (tp->t_flags & TF_NOOPT))) tp->t_flags &= ~TF_SACK_PERMIT; if (IS_FASTOPEN(tp->t_flags)) { - if (to.to_flags & TOF_FASTOPEN) { + if ((to.to_flags & TOF_FASTOPEN) && + !(tp->t_flags & TF_NOOPT)) { uint16_t mss; if (to.to_flags & TOF_MSS) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index e59a41fc1102..771ff44b8924 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1655,7 +1655,8 @@ skip_alloc: win = imin(win, TCP_MAXWIN); sc->sc_wnd = win; - if (V_tcp_do_rfc1323) { + if (V_tcp_do_rfc1323 && + !(ltflags & TF_NOOPT)) { /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies.