|
@@ -2164,8 +2164,7 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
|
|
{
|
|
{
|
|
struct tcp_sock *tp = tcp_sk(sk);
|
|
struct tcp_sock *tp = tcp_sk(sk);
|
|
struct sk_buff *skb;
|
|
struct sk_buff *skb;
|
|
- int cnt, oldcnt;
|
|
|
|
- int err;
|
|
|
|
|
|
+ int cnt, oldcnt, lost;
|
|
unsigned int mss;
|
|
unsigned int mss;
|
|
/* Use SACK to deduce losses of new sequences sent during recovery */
|
|
/* Use SACK to deduce losses of new sequences sent during recovery */
|
|
const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq;
|
|
const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq;
|
|
@@ -2205,9 +2204,10 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
|
|
break;
|
|
break;
|
|
|
|
|
|
mss = tcp_skb_mss(skb);
|
|
mss = tcp_skb_mss(skb);
|
|
- err = tcp_fragment(sk, skb, (packets - oldcnt) * mss,
|
|
|
|
- mss, GFP_ATOMIC);
|
|
|
|
- if (err < 0)
|
|
|
|
|
|
+ /* If needed, chop off the prefix to mark as lost. */
|
|
|
|
+ lost = (packets - oldcnt) * mss;
|
|
|
|
+ if (lost < skb->len &&
|
|
|
|
+ tcp_fragment(sk, skb, lost, mss, GFP_ATOMIC) < 0)
|
|
break;
|
|
break;
|
|
cnt = packets;
|
|
cnt = packets;
|
|
}
|
|
}
|