aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:26:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:58 -0500
commitd83d8461f902c672bc1bd8fbc6a94e19f092da97 (patch)
tree0534c553ab92baa2eb9dbb5bba64f2c4540b1e89 /net/dccp/ipv4.c
parent22712813620fa8e682dbfb253a60ca0131da1e07 (diff)
[IP_SOCKGLUE]: Remove most of the tcp specific calls
As DCCP needs to be called in the same spots. Now we have a member in inet_sock (is_icsk), set at sock creation time from struct inet_protosw->flags (if INET_PROTOSW_ICSK is set, like for TCP and DCCP) to see if a struct sock instance is a inet_connection_sock for places like the ones in ip_sockglue.c (v4 and v6) where we previously were looking if sk_type was SOCK_STREAM, that is insufficient because we now use the same code for DCCP, that has sk_type SOCK_DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 671fbf3b2379..c363051a7f16 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -104,9 +104,9 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
104 inet->dport = usin->sin_port; 104 inet->dport = usin->sin_port;
105 inet->daddr = daddr; 105 inet->daddr = daddr;
106 106
107 dp->dccps_ext_header_len = 0; 107 inet_csk(sk)->icsk_ext_hdr_len = 0;
108 if (inet->opt != NULL) 108 if (inet->opt != NULL)
109 dp->dccps_ext_header_len = inet->opt->optlen; 109 inet_csk(sk)->icsk_ext_hdr_len = inet->opt->optlen;
110 /* 110 /*
111 * Socket identity is still unknown (sport may be zero). 111 * Socket identity is still unknown (sport may be zero).
112 * However we set state to DCCP_REQUESTING and not releasing socket 112 * However we set state to DCCP_REQUESTING and not releasing socket
@@ -191,7 +191,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
191 mtu = dst_mtu(dst); 191 mtu = dst_mtu(dst);
192 192
193 if (inet->pmtudisc != IP_PMTUDISC_DONT && 193 if (inet->pmtudisc != IP_PMTUDISC_DONT &&
194 dp->dccps_pmtu_cookie > mtu) { 194 inet_csk(sk)->icsk_pmtu_cookie > mtu) {
195 dccp_sync_mss(sk, mtu); 195 dccp_sync_mss(sk, mtu);
196 196
197 /* 197 /*
@@ -1051,6 +1051,7 @@ struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
1051int dccp_v4_init_sock(struct sock *sk) 1051int dccp_v4_init_sock(struct sock *sk)
1052{ 1052{
1053 struct dccp_sock *dp = dccp_sk(sk); 1053 struct dccp_sock *dp = dccp_sk(sk);
1054 struct inet_connection_sock *icsk = inet_csk(sk);
1054 static int dccp_ctl_socket_init = 1; 1055 static int dccp_ctl_socket_init = 1;
1055 1056
1056 dccp_options_init(&dp->dccps_options); 1057 dccp_options_init(&dp->dccps_options);
@@ -1090,10 +1091,11 @@ int dccp_v4_init_sock(struct sock *sk)
1090 dccp_ctl_socket_init = 0; 1091 dccp_ctl_socket_init = 0;
1091 1092
1092 dccp_init_xmit_timers(sk); 1093 dccp_init_xmit_timers(sk);
1093 inet_csk(sk)->icsk_rto = DCCP_TIMEOUT_INIT; 1094 icsk->icsk_rto = DCCP_TIMEOUT_INIT;
1094 sk->sk_state = DCCP_CLOSED; 1095 sk->sk_state = DCCP_CLOSED;
1095 sk->sk_write_space = dccp_write_space; 1096 sk->sk_write_space = dccp_write_space;
1096 inet_csk(sk)->icsk_af_ops = &dccp_ipv4_af_ops; 1097 icsk->icsk_af_ops = &dccp_ipv4_af_ops;
1098 icsk->icsk_sync_mss = dccp_sync_mss;
1097 dp->dccps_mss_cache = 536; 1099 dp->dccps_mss_cache = 536;
1098 dp->dccps_role = DCCP_ROLE_UNDEFINED; 1100 dp->dccps_role = DCCP_ROLE_UNDEFINED;
1099 dp->dccps_service = DCCP_SERVICE_INVALID_VALUE; 1101 dp->dccps_service = DCCP_SERVICE_INVALID_VALUE;