tcp: Fix tcp_mark_head_lost() with packets == 0
authorLennart Schulte <[email protected]>
Wed, 17 Mar 2010 02:16:29 +0000 (02:16 +0000)
committerDavid S. Miller <[email protected]>
Sat, 20 Mar 2010 05:47:22 +0000 (22:47 -0700)
A packet is marked as lost in case packets == 0, although nothing should be done.
This results in a too early retransmitted packet during recovery in some cases.
This small patch fixes this issue by returning immediately.

Signed-off-by: Lennart Schulte <[email protected]>
Signed-off-by: Arnd Hannemann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/ipv4/tcp_input.c

index 788851ca8c5d10578afceb8be921638f1ed8254d..c096a4218b8f5e44a4e495152bb385bd8e80cc38 100644 (file)
@@ -2511,6 +2511,9 @@ static void tcp_mark_head_lost(struct sock *sk, int packets)
        int err;
        unsigned int mss;
 
+       if (packets == 0)
+               return;
+
        WARN_ON(packets > tp->packets_out);
        if (tp->lost_skb_hint) {
                skb = tp->lost_skb_hint;