aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5a776897a8c7..1e97e73e5ecf 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2250,14 +2250,19 @@ static inline void tcp_moderate_cwnd(struct tcp_sock *tp)
2250 tp->snd_cwnd_stamp = tcp_time_stamp; 2250 tp->snd_cwnd_stamp = tcp_time_stamp;
2251} 2251}
2252 2252
2253static bool tcp_tsopt_ecr_before(const struct tcp_sock *tp, u32 when)
2254{
2255 return tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
2256 before(tp->rx_opt.rcv_tsecr, when);
2257}
2258
2253/* Nothing was retransmitted or returned timestamp is less 2259/* Nothing was retransmitted or returned timestamp is less
2254 * than timestamp of the first retransmission. 2260 * than timestamp of the first retransmission.
2255 */ 2261 */
2256static inline bool tcp_packet_delayed(const struct tcp_sock *tp) 2262static inline bool tcp_packet_delayed(const struct tcp_sock *tp)
2257{ 2263{
2258 return !tp->retrans_stamp || 2264 return !tp->retrans_stamp ||
2259 (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && 2265 tcp_tsopt_ecr_before(tp, tp->retrans_stamp);
2260 before(tp->rx_opt.rcv_tsecr, tp->retrans_stamp));
2261} 2266}
2262 2267
2263/* Undo procedures. */ 2268/* Undo procedures. */