aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-08-10 03:03:31 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:56:18 -0400
commit6687e988d9aeaccad6774e6a8304f681f3ec0a03 (patch)
treeecd3d28f9989847aa1dcde4782de0210aeadc290 /net/ipv4/tcp.c
parent64ce207306debd7157f47282be94770407bec01c (diff)
[ICSK]: Move TCP congestion avoidance members to icsk
This changeset basically moves tcp_sk()->{ca_ops,ca_state,etc} to inet_csk(), minimal renaming/moving done in this changeset to ease review. Most of it is just changes of struct tcp_sock * to struct sock * parameters. With this we move to a state closer to two interesting goals: 1. Generalisation of net/ipv4/tcp_diag.c, becoming inet_diag.c, being used for any INET transport protocol that has struct inet_hashinfo and are derived from struct inet_connection_sock. Keeps the userspace API, that will just not display DCCP sockets, while newer versions of tools can support DCCP. 2. INET generic transport pluggable Congestion Avoidance infrastructure, using the current TCP CA infrastructure with DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 0eed64a1991d..02848e72e9c1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1671,11 +1671,11 @@ int tcp_disconnect(struct sock *sk, int flags)
1671 tp->write_seq = 1; 1671 tp->write_seq = 1;
1672 icsk->icsk_backoff = 0; 1672 icsk->icsk_backoff = 0;
1673 tp->snd_cwnd = 2; 1673 tp->snd_cwnd = 2;
1674 tp->probes_out = 0; 1674 icsk->icsk_probes_out = 0;
1675 tp->packets_out = 0; 1675 tp->packets_out = 0;
1676 tp->snd_ssthresh = 0x7fffffff; 1676 tp->snd_ssthresh = 0x7fffffff;
1677 tp->snd_cwnd_cnt = 0; 1677 tp->snd_cwnd_cnt = 0;
1678 tcp_set_ca_state(tp, TCP_CA_Open); 1678 tcp_set_ca_state(sk, TCP_CA_Open);
1679 tcp_clear_retrans(tp); 1679 tcp_clear_retrans(tp);
1680 inet_csk_delack_init(sk); 1680 inet_csk_delack_init(sk);
1681 sk->sk_send_head = NULL; 1681 sk->sk_send_head = NULL;
@@ -1718,7 +1718,7 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
1718 name[val] = 0; 1718 name[val] = 0;
1719 1719
1720 lock_sock(sk); 1720 lock_sock(sk);
1721 err = tcp_set_congestion_control(tp, name); 1721 err = tcp_set_congestion_control(sk, name);
1722 release_sock(sk); 1722 release_sock(sk);
1723 return err; 1723 return err;
1724 } 1724 }
@@ -1886,9 +1886,9 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
1886 memset(info, 0, sizeof(*info)); 1886 memset(info, 0, sizeof(*info));
1887 1887
1888 info->tcpi_state = sk->sk_state; 1888 info->tcpi_state = sk->sk_state;
1889 info->tcpi_ca_state = tp->ca_state; 1889 info->tcpi_ca_state = icsk->icsk_ca_state;
1890 info->tcpi_retransmits = icsk->icsk_retransmits; 1890 info->tcpi_retransmits = icsk->icsk_retransmits;
1891 info->tcpi_probes = tp->probes_out; 1891 info->tcpi_probes = icsk->icsk_probes_out;
1892 info->tcpi_backoff = icsk->icsk_backoff; 1892 info->tcpi_backoff = icsk->icsk_backoff;
1893 1893
1894 if (tp->rx_opt.tstamp_ok) 1894 if (tp->rx_opt.tstamp_ok)
@@ -2016,7 +2016,7 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
2016 len = min_t(unsigned int, len, TCP_CA_NAME_MAX); 2016 len = min_t(unsigned int, len, TCP_CA_NAME_MAX);
2017 if (put_user(len, optlen)) 2017 if (put_user(len, optlen))
2018 return -EFAULT; 2018 return -EFAULT;
2019 if (copy_to_user(optval, tp->ca_ops->name, len)) 2019 if (copy_to_user(optval, icsk->icsk_ca_ops->name, len))
2020 return -EFAULT; 2020 return -EFAULT;
2021 return 0; 2021 return 0;
2022 default: 2022 default: