From cf0b450cd5176b68ac7d5bbe68aeae6bb6a5a4b8 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 8 Sep 2005 15:10:52 -0700 Subject: [TCP]: Fix off by one in tcp_fragment() "already sent" test. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/ipv4/tcp_output.c') diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 6094db5e11b..15e1134da1b 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -499,7 +499,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss /* If this packet has been sent out already, we must * adjust the various packet counters. */ - if (after(tp->snd_nxt, TCP_SKB_CB(buff)->end_seq)) { + if (!before(tp->snd_nxt, TCP_SKB_CB(buff)->end_seq)) { int diff = old_factor - tcp_skb_pcount(skb) - tcp_skb_pcount(buff); -- cgit v1.2.3 From e130af5dab2abbf01c5d92ec5ac05912cf3d9aa7 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 10 Sep 2005 17:19:09 -0700 Subject: [TCP]: Fix double adjustment of tp->{lost,left}_out in tcp_fragment(). There is an extra left_out/lost_out adjustment in tcp_fragment which means that the lost_out accounting is always wrong. This patch removes that chunk of code. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- net/ipv4/tcp_output.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'net/ipv4/tcp_output.c') diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 15e1134da1b..c10e4435e3b 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -485,11 +485,6 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; buff->tstamp = skb->tstamp; - if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { - tp->lost_out -= tcp_skb_pcount(skb); - tp->left_out -= tcp_skb_pcount(skb); - } - old_factor = tcp_skb_pcount(skb); /* Fix up tso_factor for both original and new SKB. */ -- cgit v1.2.3