Commit 4faebe25 authored by David S. Miller's avatar David S. Miller

[TCP]: Fix {lost,left}_out accounting in tcp_fragment()

Noticed by Herbert Xu.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51a0b87a
...@@ -495,10 +495,20 @@ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len) ...@@ -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; 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. */ /* 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(skb, tp->mss_cache_std);
tcp_set_skb_tso_factor(buff, 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) { if (TCP_SKB_CB(buff)->sacked&TCPCB_LOST) {
tcp_inc_pcount(&tp->lost_out, buff); tcp_inc_pcount(&tp->lost_out, buff);
tcp_inc_pcount(&tp->left_out, buff); tcp_inc_pcount(&tp->left_out, buff);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment