Skip to content

Commit

Permalink
tcp: exit if nothing to retransmit on RTO timeout
Browse files Browse the repository at this point in the history
Previously TCP only warns if its RTO timer fires and the
retransmission queue is empty, but it'll cause null pointer
reference later on. It's better to avoid such catastrophic failure
and simply exit with a warning.

Signed-off-by: Yuchung Cheng <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Reviewed-by: Neal Cardwell <[email protected]>
Reviewed-by: Soheil Hassas Yeganeh <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
yuchungcheng authored and davem330 committed Jan 17, 2019
1 parent 9b420ef commit 88f8598
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv4/tcp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,8 @@ void tcp_retransmit_timer(struct sock *sk)
*/
return;
}
if (!tp->packets_out)
goto out;

WARN_ON(tcp_rtx_queue_empty(sk));
if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk)))
return;

tp->tlp_high_seq = 0;

Expand Down

0 comments on commit 88f8598

Please sign in to comment.