]> git.hungrycats.org Git - linux/commitdiff
[TCP]: Fix {lost,left}_out accounting in tcp_fragment()
authorDavid S. Miller <davem@nuts.davemloft.net>
Sun, 12 Sep 2004 09:17:59 +0000 (02:17 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sun, 12 Sep 2004 09:17:59 +0000 (02:17 -0700)
Noticed by Herbert Xu.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index 535e438a32762520292b01777a8aaa477f9d654f..a01cc5dce632619db137154dc185cdc72988fe6b 100644 (file)
@@ -495,10 +495,20 @@ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len)
         */
        TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when;
 
+       if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) {
+               tcp_dec_pcount(&tp->lost_out, skb);
+               tcp_dec_pcount(&tp->left_out, skb);
+       }
+
        /* Fix up tso_factor for both original and new SKB.  */
        tcp_set_skb_tso_factor(skb, tp->mss_cache_std);
        tcp_set_skb_tso_factor(buff, tp->mss_cache_std);
 
+       if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) {
+               tcp_inc_pcount(&tp->lost_out, skb);
+               tcp_inc_pcount(&tp->left_out, skb);
+       }
+
        if (TCP_SKB_CB(buff)->sacked&TCPCB_LOST) {
                tcp_inc_pcount(&tp->lost_out, buff);
                tcp_inc_pcount(&tp->left_out, buff);