diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-14 02:25:19 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:54 -0500 |
commit | 6d6ee43e0b8b8d4847627fd43739b98ec2b9404f (patch) | |
tree | a2a66381d2351610c81362bf218e743f6ccf56ef /net/dccp | |
parent | fc44b9805324c0ad2733ea2feea9935cc056709d (diff) |
[TWSK]: Introduce struct timewait_sock_ops
So that we can share several timewait sockets related functions and
make the timewait mini sockets infrastructure closer to the request
mini sockets one.
Next changesets will take advantage of this, moving more code out of
TCP and DCCP v4 and v6 to common infrastructure.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ipv4.c | 9 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index bc28d71905e2..e11cda0cb6b3 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <net/icmp.h> | 20 | #include <net/icmp.h> |
21 | #include <net/inet_hashtables.h> | 21 | #include <net/inet_hashtables.h> |
22 | #include <net/sock.h> | 22 | #include <net/sock.h> |
23 | #include <net/timewait_sock.h> | ||
23 | #include <net/tcp_states.h> | 24 | #include <net/tcp_states.h> |
24 | #include <net/xfrm.h> | 25 | #include <net/xfrm.h> |
25 | 26 | ||
@@ -1309,6 +1310,10 @@ static struct request_sock_ops dccp_request_sock_ops = { | |||
1309 | .send_reset = dccp_v4_ctl_send_reset, | 1310 | .send_reset = dccp_v4_ctl_send_reset, |
1310 | }; | 1311 | }; |
1311 | 1312 | ||
1313 | static struct timewait_sock_ops dccp_timewait_sock_ops = { | ||
1314 | .twsk_obj_size = sizeof(struct inet_timewait_sock), | ||
1315 | }; | ||
1316 | |||
1312 | struct proto dccp_prot = { | 1317 | struct proto dccp_prot = { |
1313 | .name = "DCCP", | 1318 | .name = "DCCP", |
1314 | .owner = THIS_MODULE, | 1319 | .owner = THIS_MODULE, |
@@ -1332,5 +1337,7 @@ struct proto dccp_prot = { | |||
1332 | .max_header = MAX_DCCP_HEADER, | 1337 | .max_header = MAX_DCCP_HEADER, |
1333 | .obj_size = sizeof(struct dccp_sock), | 1338 | .obj_size = sizeof(struct dccp_sock), |
1334 | .rsk_prot = &dccp_request_sock_ops, | 1339 | .rsk_prot = &dccp_request_sock_ops, |
1335 | .twsk_obj_size = sizeof(struct inet_timewait_sock), | 1340 | .twsk_prot = &dccp_timewait_sock_ops, |
1336 | }; | 1341 | }; |
1342 | |||
1343 | EXPORT_SYMBOL_GPL(dccp_prot); | ||
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index a7d2aee5b3af..4d078f5b911b 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -652,6 +652,10 @@ static struct request_sock_ops dccp6_request_sock_ops = { | |||
652 | .send_reset = dccp_v6_ctl_send_reset, | 652 | .send_reset = dccp_v6_ctl_send_reset, |
653 | }; | 653 | }; |
654 | 654 | ||
655 | static struct timewait_sock_ops dccp6_timewait_sock_ops = { | ||
656 | .twsk_obj_size = sizeof(struct dccp6_timewait_sock), | ||
657 | }; | ||
658 | |||
655 | static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) | 659 | static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) |
656 | { | 660 | { |
657 | struct ipv6_pinfo *np = inet6_sk(sk); | 661 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -1359,7 +1363,7 @@ static struct proto dccp_v6_prot = { | |||
1359 | .max_header = MAX_DCCP_HEADER, | 1363 | .max_header = MAX_DCCP_HEADER, |
1360 | .obj_size = sizeof(struct dccp6_sock), | 1364 | .obj_size = sizeof(struct dccp6_sock), |
1361 | .rsk_prot = &dccp6_request_sock_ops, | 1365 | .rsk_prot = &dccp6_request_sock_ops, |
1362 | .twsk_obj_size = sizeof(struct dccp6_timewait_sock), | 1366 | .twsk_prot = &dccp6_timewait_sock_ops, |
1363 | }; | 1367 | }; |
1364 | 1368 | ||
1365 | static struct inet6_protocol dccp_v6_protocol = { | 1369 | static struct inet6_protocol dccp_v6_protocol = { |