aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 706a99ec73f6..077d9abdfcf5 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5647,6 +5647,32 @@ discard:
5647} 5647}
5648EXPORT_SYMBOL(tcp_rcv_established); 5648EXPORT_SYMBOL(tcp_rcv_established);
5649 5649
5650void tcp_init_transfer(struct sock *sk, int bpf_op)
5651{
5652 struct inet_connection_sock *icsk = inet_csk(sk);
5653 struct tcp_sock *tp = tcp_sk(sk);
5654
5655 tcp_mtup_init(sk);
5656 icsk->icsk_af_ops->rebuild_header(sk);
5657 tcp_init_metrics(sk);
5658
5659 /* Initialize the congestion window to start the transfer.
5660 * Cut cwnd down to 1 per RFC5681 if SYN or SYN-ACK has been
5661 * retransmitted. In light of RFC6298 more aggressive 1sec
5662 * initRTO, we only reset cwnd when more than 1 SYN/SYN-ACK
5663 * retransmission has occurred.
5664 */
5665 if (tp->total_retrans > 1 && tp->undo_marker)
5666 tp->snd_cwnd = 1;
5667 else
5668 tp->snd_cwnd = tcp_init_cwnd(tp, __sk_dst_get(sk));
5669 tp->snd_cwnd_stamp = tcp_jiffies32;
5670
5671 tcp_call_bpf(sk, bpf_op, 0, NULL);
5672 tcp_init_congestion_control(sk);
5673 tcp_init_buffer_space(sk);
5674}
5675
5650void tcp_finish_connect(struct sock *sk, struct sk_buff *skb) 5676void tcp_finish_connect(struct sock *sk, struct sk_buff *skb)
5651{ 5677{
5652 struct tcp_sock *tp = tcp_sk(sk); 5678 struct tcp_sock *tp = tcp_sk(sk);