diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2d656eef7f8e..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; |
@@ -2478,6 +2476,9 @@ static void tcp_cwnd_reduction(struct sock *sk, const int prior_unsacked, | |||
2478 | int newly_acked_sacked = prior_unsacked - | 2476 | int newly_acked_sacked = prior_unsacked - |
2479 | (tp->packets_out - tp->sacked_out); | 2477 | (tp->packets_out - tp->sacked_out); |
2480 | 2478 | ||
2479 | if (newly_acked_sacked <= 0 || WARN_ON_ONCE(!tp->prior_cwnd)) | ||
2480 | return; | ||
2481 | |||
2481 | tp->prr_delivered += newly_acked_sacked; | 2482 | tp->prr_delivered += newly_acked_sacked; |
2482 | if (delta < 0) { | 2483 | if (delta < 0) { |
2483 | u64 dividend = (u64)tp->snd_ssthresh * tp->prr_delivered + | 2484 | u64 dividend = (u64)tp->snd_ssthresh * tp->prr_delivered + |
@@ -6204,7 +6205,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
6204 | tcp_openreq_init(req, &tmp_opt, skb, sk); | 6205 | tcp_openreq_init(req, &tmp_opt, skb, sk); |
6205 | 6206 | ||
6206 | /* Note: tcp_v6_init_req() might override ir_iif for link locals */ | 6207 | /* Note: tcp_v6_init_req() might override ir_iif for link locals */ |
6207 | inet_rsk(req)->ir_iif = sk->sk_bound_dev_if; | 6208 | inet_rsk(req)->ir_iif = inet_request_bound_dev_if(sk, skb); |
6208 | 6209 | ||
6209 | af_ops->init_req(req, sk, skb); | 6210 | af_ops->init_req(req, sk, skb); |
6210 | 6211 | ||