Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2024 04:56:52 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1a264ff0cca7 - stable/14 - tcp_output: Clear FIN if tcp_m_copym truncates output length
Message-ID:  <202412010456.4B14uqWT094324@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by jhb:

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

commit 1a264ff0cca786b0cb1fdb5037805db02edcaa20
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-10-02 19:12:37 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-12-01 02:46:04 +0000

    tcp_output: Clear FIN if tcp_m_copym truncates output length
    
    Reviewed by:    rscheff, tuexen, gallatin
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D46824
    
    (cherry picked from commit 519981e3c09c2875b136635459c87ab24d3104e2)
---
 sys/netinet/tcp_output.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index d1a81123ebad..9855083b579a 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1088,13 +1088,18 @@ send:
 				sbsndptr_adv(&so->so_snd, mb, len);
 			m->m_len += len;
 		} else {
+			int32_t old_len;
+
 			if (SEQ_LT(tp->snd_nxt, tp->snd_max))
 				msb = NULL;
 			else
 				msb = &so->so_snd;
+			old_len = len;
 			m->m_next = tcp_m_copym(mb, moff,
 			    &len, if_hw_tsomaxsegcount,
 			    if_hw_tsomaxsegsize, msb, hw_tls);
+			if (old_len != len)
+				flags &= ~TH_FIN;
 			if (len <= (tp->t_maxseg - optlen)) {
 				/*
 				 * Must have ran out of mbufs for the copy



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