From: David S. Miller Date: Tue, 23 Sep 2008 09:51:41 +0000 (-0700) Subject: tcp: Fix queue traversal in tcp_use_frto(). X-Git-Tag: v2.6.28-rc1~717^2~199 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=28e3487b7dd8a9791baac924bc887140ec747bed;p=linux-2.6-omap-h63xx.git tcp: Fix queue traversal in tcp_use_frto(). We must check tcp_skb_is_last() before doing a tcp_write_queue_next(). Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index cbfe13d5f42..3b76bce769d 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -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))