From 5cb636f7a4fadacc1b5e61b9b5f40e9e2be9adb0 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:22:57 +0100 Subject: [PATCH] Revert "tcp: fix to allow timestamp undo if no retransmits were sent" This reverts commit 0295a863b0124a3801a61bdff5aac4a37753f18e. --- net/ipv4/tcp_input.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index e4c79a958..7f3e2df0c 100755 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2424,22 +2424,8 @@ static bool tcp_skb_spurious_retrans(const struct tcp_sock *tp, */ static inline bool tcp_packet_delayed(const struct tcp_sock *tp) { - const struct sock *sk = (const struct sock *)tp; - - if (tp->retrans_stamp && - tcp_tsopt_ecr_before(tp, tp->retrans_stamp)) - return true; /* got echoed TS before first retransmission */ - - /* Check if nothing was retransmitted (retrans_stamp==0), which may - * happen in fast recovery due to TSQ. But we ignore zero retrans_stamp - * in TCP_SYN_SENT, since when we set FLAG_SYN_ACKED we also clear - * retrans_stamp even if we had retransmitted the SYN. - */ - if (!tp->retrans_stamp && /* no record of a retransmit/SYN? */ - sk->sk_state != TCP_SYN_SENT) /* not the FLAG_SYN_ACKED case? */ - return true; /* nothing was retransmitted */ - - return false; + return tp->retrans_stamp && + tcp_tsopt_ecr_before(tp, tp->retrans_stamp); } /* Undo procedures. */