Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175544
b: refs/heads/master
c: 07f29bc
h: refs/heads/master
v: v3
  • Loading branch information
Damian Lukowski authored and David S. Miller committed Dec 9, 2009
1 parent c1785c1 commit 1617392
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb19054697e92a793f336380fd72c588521178ff
refs/heads/master: 07f29bc5bbae4e53e982ab956fed7207990a7786
10 changes: 8 additions & 2 deletions trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1265,14 +1265,20 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
* TCP connection after "boundary" unsucessful, exponentially backed-off
* retransmissions with an initial RTO of TCP_RTO_MIN.
*/
static inline bool retransmits_timed_out(const struct sock *sk,
static inline bool retransmits_timed_out(struct sock *sk,
unsigned int boundary)
{
unsigned int timeout, linear_backoff_thresh;
unsigned int start_ts;

if (!inet_csk(sk)->icsk_retransmits)
return false;

if (unlikely(!tcp_sk(sk)->retrans_stamp))
start_ts = TCP_SKB_CB(tcp_write_queue_head(sk))->when;
else
start_ts = tcp_sk(sk)->retrans_stamp;

linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN);

if (boundary <= linear_backoff_thresh)
Expand All @@ -1281,7 +1287,7 @@ static inline bool retransmits_timed_out(const struct sock *sk,
timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN +
(boundary - linear_backoff_thresh) * TCP_RTO_MAX;

return (tcp_time_stamp - tcp_sk(sk)->retrans_stamp) >= timeout;
return (tcp_time_stamp - start_ts) >= timeout;
}

static inline struct sk_buff *tcp_send_head(struct sock *sk)
Expand Down

0 comments on commit 1617392

Please sign in to comment.