git: 544bfa7cea3b - stable/14 - tcp: properly initialize LRD while accepting session in syncache

From: Richard Scheffenegger <rscheff_at_FreeBSD.org>
Date: Sat, 16 Dec 2023 10:29:47 UTC
The branch stable/14 has been updated by rscheff:

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

commit 544bfa7cea3bb9e9525d84fad42a406912f42e17
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2023-12-02 11:15:37 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2023-12-15 08:23:45 +0000

    tcp: properly initialize LRD while accepting session in syncache
    
    Inherit the setting from the listener socket in syncache_socket.
    
    MFC after:             2 weeks
    Reviewed By:           tuexen, #transport
    Sponsored by:          NetApp, Inc.
    Differential Revision: https://reviews.freebsd.org/D42874
    
    (cherry picked from commit f071abd92e726fc12e9256662e1f286f364252ee)
---
 sys/netinet/tcp_syncache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index ffde6a4b88c9..2c381ef600d6 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -952,7 +952,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
 	tp->rcv_adv += tp->rcv_wnd;
 	tp->last_ack_sent = tp->rcv_nxt;
 
-	tp->t_flags = sototcpcb(lso)->t_flags & (TF_NOPUSH|TF_NODELAY);
+	tp->t_flags = sototcpcb(lso)->t_flags &
+	    (TF_LRD|TF_NOPUSH|TF_NODELAY);
 	if (sc->sc_flags & SCF_NOOPT)
 		tp->t_flags |= TF_NOOPT;
 	else {