The branch stable/13 has been updated by rscheff:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c0c928636156dd913302bc34e5ac9d70810f5cdd

commit c0c928636156dd913302bc34e5ac9d70810f5cdd
Author:     Richard Scheffenegger <rsch...@freebsd.org>
AuthorDate: 2021-02-25 18:10:55 +0000
Commit:     Richard Scheffenegger <rsch...@freebsd.org>
CommitDate: 2021-02-28 08:11:18 +0000

    TCP_NOOPT may prevent the negotiation of TCP features, which a server
    has to take into consideration.
    
    PR:     253576
    Reviewed By:    tuexen, #transport
    MFC after:      3 days
    Sponsored by:   NetApp, Inc.
    Differential Revision: https://reviews.freebsd.org/D28652
    
    (cherry picked from commit 2593f858d7d078efa85f78f20b6bfa0931cc1dc5)
---
 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 e096f2a13679..42f983f64502 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1649,7 +1649,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
@@ -1660,7 +1661,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();
@@ -1669,10 +1671,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.
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to