tcp.c (b3fdfc1b4b641d372e35ced98814289bc60bc5d1) tcp.c (740b0f1841f6e39085b711d41db9ffb07198682b)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Implementation of the Transmission Control Protocol(TCP).
7 *
8 * Authors: Ross Biro

--- 373 unchanged lines hidden (view full) ---

382 struct tcp_sock *tp = tcp_sk(sk);
383
384 __skb_queue_head_init(&tp->out_of_order_queue);
385 tcp_init_xmit_timers(sk);
386 tcp_prequeue_init(tp);
387 INIT_LIST_HEAD(&tp->tsq_node);
388
389 icsk->icsk_rto = TCP_TIMEOUT_INIT;
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Implementation of the Transmission Control Protocol(TCP).
7 *
8 * Authors: Ross Biro

--- 373 unchanged lines hidden (view full) ---

382 struct tcp_sock *tp = tcp_sk(sk);
383
384 __skb_queue_head_init(&tp->out_of_order_queue);
385 tcp_init_xmit_timers(sk);
386 tcp_prequeue_init(tp);
387 INIT_LIST_HEAD(&tp->tsq_node);
388
389 icsk->icsk_rto = TCP_TIMEOUT_INIT;
390 tp->mdev = TCP_TIMEOUT_INIT;
390 tp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT);
391
392 /* So many TCP implementations out there (incorrectly) count the
393 * initial SYN frame in their delayed-ACK and congestion control
394 * algorithms that we must have the following bandaid to talk
395 * efficiently to them. -DaveM
396 */
397 tp->snd_cwnd = TCP_INIT_CWND;
398

--- 1935 unchanged lines hidden (view full) ---

2334
2335 inet->inet_dport = 0;
2336
2337 if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK))
2338 inet_reset_saddr(sk);
2339
2340 sk->sk_shutdown = 0;
2341 sock_reset_flag(sk, SOCK_DONE);
391
392 /* So many TCP implementations out there (incorrectly) count the
393 * initial SYN frame in their delayed-ACK and congestion control
394 * algorithms that we must have the following bandaid to talk
395 * efficiently to them. -DaveM
396 */
397 tp->snd_cwnd = TCP_INIT_CWND;
398

--- 1935 unchanged lines hidden (view full) ---

2334
2335 inet->inet_dport = 0;
2336
2337 if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK))
2338 inet_reset_saddr(sk);
2339
2340 sk->sk_shutdown = 0;
2341 sock_reset_flag(sk, SOCK_DONE);
2342 tp->srtt = 0;
2342 tp->srtt_us = 0;
2343 if ((tp->write_seq += tp->max_window + 2) == 0)
2344 tp->write_seq = 1;
2345 icsk->icsk_backoff = 0;
2346 tp->snd_cwnd = 2;
2347 icsk->icsk_probes_out = 0;
2348 tp->packets_out = 0;
2349 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
2350 tp->snd_cwnd_cnt = 0;

--- 427 unchanged lines hidden (view full) ---

2778 info->tcpi_fackets = tp->fackets_out;
2779
2780 info->tcpi_last_data_sent = jiffies_to_msecs(now - tp->lsndtime);
2781 info->tcpi_last_data_recv = jiffies_to_msecs(now - icsk->icsk_ack.lrcvtime);
2782 info->tcpi_last_ack_recv = jiffies_to_msecs(now - tp->rcv_tstamp);
2783
2784 info->tcpi_pmtu = icsk->icsk_pmtu_cookie;
2785 info->tcpi_rcv_ssthresh = tp->rcv_ssthresh;
2343 if ((tp->write_seq += tp->max_window + 2) == 0)
2344 tp->write_seq = 1;
2345 icsk->icsk_backoff = 0;
2346 tp->snd_cwnd = 2;
2347 icsk->icsk_probes_out = 0;
2348 tp->packets_out = 0;
2349 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
2350 tp->snd_cwnd_cnt = 0;

--- 427 unchanged lines hidden (view full) ---

2778 info->tcpi_fackets = tp->fackets_out;
2779
2780 info->tcpi_last_data_sent = jiffies_to_msecs(now - tp->lsndtime);
2781 info->tcpi_last_data_recv = jiffies_to_msecs(now - icsk->icsk_ack.lrcvtime);
2782 info->tcpi_last_ack_recv = jiffies_to_msecs(now - tp->rcv_tstamp);
2783
2784 info->tcpi_pmtu = icsk->icsk_pmtu_cookie;
2785 info->tcpi_rcv_ssthresh = tp->rcv_ssthresh;
2786 info->tcpi_rtt = jiffies_to_usecs(tp->srtt)>>3;
2787 info->tcpi_rttvar = jiffies_to_usecs(tp->mdev)>>2;
2786 info->tcpi_rtt = tp->srtt_us >> 3;
2787 info->tcpi_rttvar = tp->mdev_us >> 2;
2788 info->tcpi_snd_ssthresh = tp->snd_ssthresh;
2789 info->tcpi_snd_cwnd = tp->snd_cwnd;
2790 info->tcpi_advmss = tp->advmss;
2791 info->tcpi_reordering = tp->reordering;
2792
2793 info->tcpi_rcv_rtt = jiffies_to_usecs(tp->rcv_rtt_est.rtt)>>3;
2794 info->tcpi_rcv_space = tp->rcvq_space.space;
2795
2796 info->tcpi_total_retrans = tp->total_retrans;
2788 info->tcpi_snd_ssthresh = tp->snd_ssthresh;
2789 info->tcpi_snd_cwnd = tp->snd_cwnd;
2790 info->tcpi_advmss = tp->advmss;
2791 info->tcpi_reordering = tp->reordering;
2792
2793 info->tcpi_rcv_rtt = jiffies_to_usecs(tp->rcv_rtt_est.rtt)>>3;
2794 info->tcpi_rcv_space = tp->rcvq_space.space;
2795
2796 info->tcpi_total_retrans = tp->total_retrans;
2797
2798 info->tcpi_pacing_rate = sk->sk_pacing_rate != ~0U ?
2799 sk->sk_pacing_rate : ~0ULL;
2800 info->tcpi_max_pacing_rate = sk->sk_max_pacing_rate != ~0U ?
2801 sk->sk_max_pacing_rate : ~0ULL;
2797}
2798EXPORT_SYMBOL_GPL(tcp_get_info);
2799
2800static int do_tcp_getsockopt(struct sock *sk, int level,
2801 int optname, char __user *optval, int __user *optlen)
2802{
2803 struct inet_connection_sock *icsk = inet_csk(sk);
2804 struct tcp_sock *tp = tcp_sk(sk);

--- 425 unchanged lines hidden ---
2802}
2803EXPORT_SYMBOL_GPL(tcp_get_info);
2804
2805static int do_tcp_getsockopt(struct sock *sk, int level,
2806 int optname, char __user *optval, int __user *optlen)
2807{
2808 struct inet_connection_sock *icsk = inet_csk(sk);
2809 struct tcp_sock *tp = tcp_sk(sk);

--- 425 unchanged lines hidden ---