]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tcp: Apply max RTO to non-TFO SYN+ACK.
authorKuniyuki Iwashima <kuniyu@google.com>
Thu, 6 Nov 2025 00:32:44 +0000 (00:32 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Nov 2025 02:05:26 +0000 (18:05 -0800)
Since commit 54a378f43425 ("tcp: add the ability to control
max RTO"), TFO SYN+ACK RTO is capped by the TFO full sk's
inet_csk(sk)->icsk_rto_max.

The value is inherited from the parent listener.

Let's apply the same cap to non-TFO SYN+ACK.

Note that req->rsk_listener is always non-NULL when we call
tcp_reqsk_timeout() in reqsk_timer_handler() or tcp_check_req().

It could be NULL for SYN cookie req, but we do not use
req->timeout then.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251106003357.273403-6-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h

index 0c7274ac7ed5bfdb6b01e2fbff613f5ced6ee9f9..4833ec7903eca45cd31bb4ab023a8d326ed8b436 100644 (file)
@@ -845,7 +845,8 @@ static inline unsigned long tcp_reqsk_timeout(struct request_sock *req)
 {
        u64 timeout = (u64)req->timeout << req->num_timeout;
 
-       return (unsigned long)min_t(u64, timeout, TCP_RTO_MAX);
+       return (unsigned long)min_t(u64, timeout,
+                                   tcp_rto_max(req->rsk_listener));
 }
 
 u32 tcp_delack_max(const struct sock *sk);