Fix TCP FIN handling
authorJohn Heffner <jheffner@psc.edu>
Wed, 7 Feb 2007 05:57:34 +0000 (21:57 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Mar 2007 18:50:19 +0000 (10:50 -0800)
We can accidently spit out a huge burst of packets with TSO
when the FIN back is piggybacked onto the final packet.

[TCP]: Don't apply FIN exception to full TSO segments.

Signed-off-by: John Heffner <jheffner@psc.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/tcp_output.c

index 975f4472af29c750daec8a0ae02c0e958a578929..58b7111523f4a4540fbc9833347565e41d13b979 100644 (file)
@@ -965,7 +965,8 @@ static inline unsigned int tcp_cwnd_test(struct tcp_sock *tp, struct sk_buff *sk
        u32 in_flight, cwnd;
 
        /* Don't be strict about the congestion window for the final FIN.  */
-       if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)
+       if ((TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) &&
+           tcp_skb_pcount(skb) == 1)
                return 1;
 
        in_flight = tcp_packets_in_flight(tp);