Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Feb 2021 11:18:26 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ed782b9f5a7a - main - tcp: improve behaviour when using TCP_NOOPT
Message-ID:  <202102141118.11EBIQkn051139@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen:

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

commit ed782b9f5a7a05debe944a33b4ac9e5629a95803
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-02-14 11:10:31 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-02-14 11:16:57 +0000

    tcp: improve behaviour when using TCP_NOOPT
    
    Use ISS for SEG.SEQ when sending a SYN-ACK segment in response to
    an SYN segment received in the SYN-SENT state on a socket having
    the IPPROTO_TCP level socket option TCP_NOOPT enabled.
    
    Reviewed by:            rscheff
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D28656
---
 sys/netinet/tcp_output.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index cacc0c51bd8e..b4c7ab0a1ab7 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -785,6 +785,10 @@ send:
 #endif
 		hdrlen = sizeof (struct tcpiphdr);
 
+	if (flags & TH_SYN) {
+		tp->snd_nxt = tp->iss;
+	}
+
 	/*
 	 * Compute options for segment.
 	 * We only have to care about SYN and established connection
@@ -795,7 +799,6 @@ send:
 	if ((tp->t_flags & TF_NOOPT) == 0) {
 		/* Maximum segment size. */
 		if (flags & TH_SYN) {
-			tp->snd_nxt = tp->iss;
 			to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc);
 			to.to_flags |= TOF_MSS;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102141118.11EBIQkn051139>