]> git.hungrycats.org Git - linux/commitdiff
tcp: Fix tcp_mark_head_lost() with packets == 0
authorLennart Schulte <lennart.schulte@nets.rwth-aachen.de>
Wed, 17 Mar 2010 02:16:29 +0000 (02:16 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 23:02:11 +0000 (16:02 -0700)
[ Upstream commit 6830c25b7d08fbbd922959425193791bc42079f2 ]

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 <lennart.schulte@nets.rwth-aachen.de>
Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/tcp_input.c

index 3fddc69ccccc5a10032c2b50aff50ebd38a8c137..b347d3c46b1a0fa2079213dcb56f7fdfb463a21c 100644 (file)
@@ -2499,6 +2499,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;