From: Herbert Xu Date: Thu, 8 Sep 2005 22:10:52 +0000 (-0700) Subject: [TCP]: Fix off by one in tcp_fragment() "already sent" test. X-Git-Tag: v2.6.14-rc1~492^2~22^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf0b450cd5176b68ac7d5bbe68aeae6bb6a5a4b8;p=linux-2.6 [TCP]: Fix off by one in tcp_fragment() "already sent" test. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 6094db5e11..15e1134da1 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);