diff options
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index fa34984d0b12..d212f183dd2d 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -22,6 +22,20 @@ | |||
22 | #include <linux/gfp.h> | 22 | #include <linux/gfp.h> |
23 | #include <net/tcp.h> | 23 | #include <net/tcp.h> |
24 | 24 | ||
25 | u32 tcp_retransmit_stamp(const struct sock *sk) | ||
26 | { | ||
27 | u32 start_ts = tcp_sk(sk)->retrans_stamp; | ||
28 | |||
29 | if (unlikely(!start_ts)) { | ||
30 | struct sk_buff *head = tcp_rtx_queue_head(sk); | ||
31 | |||
32 | if (!head) | ||
33 | return 0; | ||
34 | start_ts = tcp_skb_timestamp(head); | ||
35 | } | ||
36 | return start_ts; | ||
37 | } | ||
38 | |||
25 | /** | 39 | /** |
26 | * tcp_write_err() - close socket and save error info | 40 | * tcp_write_err() - close socket and save error info |
27 | * @sk: The socket the error has appeared on. | 41 | * @sk: The socket the error has appeared on. |
@@ -166,14 +180,9 @@ static bool retransmits_timed_out(struct sock *sk, | |||
166 | if (!inet_csk(sk)->icsk_retransmits) | 180 | if (!inet_csk(sk)->icsk_retransmits) |
167 | return false; | 181 | return false; |
168 | 182 | ||
169 | start_ts = tcp_sk(sk)->retrans_stamp; | 183 | start_ts = tcp_retransmit_stamp(sk); |
170 | if (unlikely(!start_ts)) { | 184 | if (!start_ts) |
171 | struct sk_buff *head = tcp_rtx_queue_head(sk); | 185 | return false; |
172 | |||
173 | if (!head) | ||
174 | return false; | ||
175 | start_ts = tcp_skb_timestamp(head); | ||
176 | } | ||
177 | 186 | ||
178 | if (likely(timeout == 0)) { | 187 | if (likely(timeout == 0)) { |
179 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base); | 188 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base); |