aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/tcp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e2d2ca2509be..e54bd85d9d40 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1265,14 +1265,20 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
1265 * TCP connection after "boundary" unsucessful, exponentially backed-off 1265 * TCP connection after "boundary" unsucessful, exponentially backed-off
1266 * retransmissions with an initial RTO of TCP_RTO_MIN. 1266 * retransmissions with an initial RTO of TCP_RTO_MIN.
1267 */ 1267 */
1268static inline bool retransmits_timed_out(const struct sock *sk, 1268static inline bool retransmits_timed_out(struct sock *sk,
1269 unsigned int boundary) 1269 unsigned int boundary)
1270{ 1270{
1271 unsigned int timeout, linear_backoff_thresh; 1271 unsigned int timeout, linear_backoff_thresh;
1272 unsigned int start_ts;
1272 1273
1273 if (!inet_csk(sk)->icsk_retransmits) 1274 if (!inet_csk(sk)->icsk_retransmits)
1274 return false; 1275 return false;
1275 1276
1277 if (unlikely(!tcp_sk(sk)->retrans_stamp))
1278 start_ts = TCP_SKB_CB(tcp_write_queue_head(sk))->when;
1279 else
1280 start_ts = tcp_sk(sk)->retrans_stamp;
1281
1276 linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); 1282 linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN);
1277 1283
1278 if (boundary <= linear_backoff_thresh) 1284 if (boundary <= linear_backoff_thresh)
@@ -1281,7 +1287,7 @@ static inline bool retransmits_timed_out(const struct sock *sk,
1281 timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + 1287 timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN +
1282 (boundary - linear_backoff_thresh) * TCP_RTO_MAX; 1288 (boundary - linear_backoff_thresh) * TCP_RTO_MAX;
1283 1289
1284 return (tcp_time_stamp - tcp_sk(sk)->retrans_stamp) >= timeout; 1290 return (tcp_time_stamp - start_ts) >= timeout;
1285} 1291}
1286 1292
1287static inline struct sk_buff *tcp_send_head(struct sock *sk) 1293static inline struct sk_buff *tcp_send_head(struct sock *sk)