diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 0003d409fec5..1c2a73406261 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2164,8 +2164,7 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head) | |||
2164 | { | 2164 | { |
2165 | struct tcp_sock *tp = tcp_sk(sk); | 2165 | struct tcp_sock *tp = tcp_sk(sk); |
2166 | struct sk_buff *skb; | 2166 | struct sk_buff *skb; |
2167 | int cnt, oldcnt; | 2167 | int cnt, oldcnt, lost; |
2168 | int err; | ||
2169 | unsigned int mss; | 2168 | unsigned int mss; |
2170 | /* Use SACK to deduce losses of new sequences sent during recovery */ | 2169 | /* Use SACK to deduce losses of new sequences sent during recovery */ |
2171 | const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq; | 2170 | 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) | |||
2205 | break; | 2204 | break; |
2206 | 2205 | ||
2207 | mss = tcp_skb_mss(skb); | 2206 | mss = tcp_skb_mss(skb); |
2208 | err = tcp_fragment(sk, skb, (packets - oldcnt) * mss, | 2207 | /* If needed, chop off the prefix to mark as lost. */ |
2209 | mss, GFP_ATOMIC); | 2208 | lost = (packets - oldcnt) * mss; |
2210 | if (err < 0) | 2209 | if (lost < skb->len && |
2210 | tcp_fragment(sk, skb, lost, mss, GFP_ATOMIC) < 0) | ||
2211 | break; | 2211 | break; |
2212 | cnt = packets; | 2212 | cnt = packets; |
2213 | } | 2213 | } |
@@ -2366,8 +2366,6 @@ static void tcp_undo_cwnd_reduction(struct sock *sk, bool unmark_loss) | |||
2366 | tp->snd_ssthresh = tp->prior_ssthresh; | 2366 | tp->snd_ssthresh = tp->prior_ssthresh; |
2367 | tcp_ecn_withdraw_cwr(tp); | 2367 | tcp_ecn_withdraw_cwr(tp); |
2368 | } | 2368 | } |
2369 | } else { | ||
2370 | tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh); | ||
2371 | } | 2369 | } |
2372 | tp->snd_cwnd_stamp = tcp_time_stamp; | 2370 | tp->snd_cwnd_stamp = tcp_time_stamp; |
2373 | tp->undo_marker = 0; | 2371 | tp->undo_marker = 0; |