Skip to content

Commit

Permalink
tcp: Fix queue traversal in tcp_use_frto().
Browse files Browse the repository at this point in the history
We must check tcp_skb_is_last() before doing a tcp_write_queue_next().

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 23, 2008
1 parent 77d40a0 commit 28e3487
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,8 @@ int tcp_use_frto(struct sock *sk)
return 0;

skb = tcp_write_queue_head(sk);
if (tcp_skb_is_last(sk, skb))
return 1;
skb = tcp_write_queue_next(sk, skb); /* Skips head */
tcp_for_write_queue_from(skb, sk) {
if (skb == tcp_send_head(sk))
Expand Down

0 comments on commit 28e3487

Please sign in to comment.