aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-08-09 23:45:21 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:56:03 -0400
commit64cf1e5d8b5f88d56509260e08fa0d8314277350 (patch)
tree1b2decb48c52d8f3f3abe04ffb8e0dca80f0747a /net/dccp/ipv4.c
parent696ab2d3bffc746fb8cf3712f066d42b9886aeed (diff)
[DCCP]: Finish the TIMEWAIT minisock support
Using most of the infrastructure TCP uses, with a dccp_death_row, etc. As per my current interpretation of the draft what we have with this changeset seems to be all we need (or very close to it 8)). 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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 6bccf4dd1e70..f6da9328221e 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -97,7 +97,7 @@ static int __dccp_v4_check_established(struct sock *sk, const __u16 lport,
97 NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); 97 NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
98 } else if (tw != NULL) { 98 } else if (tw != NULL) {
99 /* Silly. Should hash-dance instead... */ 99 /* Silly. Should hash-dance instead... */
100 dccp_tw_deschedule(tw); 100 inet_twsk_deschedule(tw, &dccp_death_row);
101 NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); 101 NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
102 102
103 inet_twsk_put(tw); 103 inet_twsk_put(tw);
@@ -201,7 +201,7 @@ ok:
201 spin_unlock(&head->lock); 201 spin_unlock(&head->lock);
202 202
203 if (tw != NULL) { 203 if (tw != NULL) {
204 dccp_tw_deschedule(tw); 204 inet_twsk_deschedule(tw, &dccp_death_row);
205 inet_twsk_put(tw); 205 inet_twsk_put(tw);
206 } 206 }
207 207
@@ -1131,8 +1131,9 @@ int dccp_v4_rcv(struct sk_buff *skb)
1131 */ 1131 */
1132 1132
1133 if (sk->sk_state == DCCP_TIME_WAIT) { 1133 if (sk->sk_state == DCCP_TIME_WAIT) {
1134 dccp_pr_debug("sk->sk_state == DCCP_TIME_WAIT: discard_and_relse\n"); 1134 dccp_pr_debug("sk->sk_state == DCCP_TIME_WAIT: "
1135 goto discard_and_relse; 1135 "do_time_wait\n");
1136 goto do_time_wait;
1136 } 1137 }
1137 1138
1138 if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) { 1139 if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) {
@@ -1179,6 +1180,10 @@ discard_it:
1179discard_and_relse: 1180discard_and_relse:
1180 sock_put(sk); 1181 sock_put(sk);
1181 goto discard_it; 1182 goto discard_it;
1183
1184do_time_wait:
1185 inet_twsk_put((struct inet_timewait_sock *)sk);
1186 goto no_dccp_socket;
1182} 1187}
1183 1188
1184static int dccp_v4_init_sock(struct sock *sk) 1189static int dccp_v4_init_sock(struct sock *sk)
@@ -1290,5 +1295,5 @@ struct proto dccp_v4_prot = {
1290 .max_header = MAX_DCCP_HEADER, 1295 .max_header = MAX_DCCP_HEADER,
1291 .obj_size = sizeof(struct dccp_sock), 1296 .obj_size = sizeof(struct dccp_sock),
1292 .rsk_prot = &dccp_request_sock_ops, 1297 .rsk_prot = &dccp_request_sock_ops,
1293 .twsk_obj_size = sizeof(struct inet_timewait_sock), /* FIXME! create dccp_timewait_sock */ 1298 .twsk_obj_size = sizeof(struct inet_timewait_sock),
1294}; 1299};