tcp: fix TSO FACK loss marking in tcp_mark_head_lost

When TCP uses FACK algorithm to mark lost packets in
tcp_mark_head_lost(), if the number of packets in the (TSO) skb is
greater than the number of packets that should be marked lost, TCP
incorrectly exits the loop and marks no packets lost in the skb. This
underestimates tp->lost_out and affects the recovery/retransmission.
This patch fargments the skb and marks the correct amount of packets
lost.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Yuchung Cheng and committed by David S. Miller b3de7559 3fd6c88e

+2 -1
+2 -1
net/ipv4/tcp_input.c
··· 2545 2545 cnt += tcp_skb_pcount(skb); 2546 2546 2547 2547 if (cnt > packets) { 2548 - if (tcp_is_sack(tp) || (oldcnt >= packets)) 2548 + if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) || 2549 + (oldcnt >= packets)) 2549 2550 break; 2550 2551 2551 2552 mss = skb_shinfo(skb)->gso_size;