diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-21 01:01:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:01:03 -0500 |
commit | c4d9390941aee136fd35bb38eb1d6de4e3b1487d (patch) | |
tree | fcaf0032ba5971145b5f527b8635cd7aa3a39d8c /net/dccp/ipv4.c | |
parent | 72478873571d869906f7a250b09e12fa5b65e321 (diff) |
[ICSK]: Introduce inet_csk_ctl_sock_create
Consolidating open coded sequences in tcp and dccp, v4 and v6.
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.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index f53bce590ade..7098f1055f4a 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -1099,29 +1099,6 @@ static struct inet_protosw dccp_v4_protosw = { | |||
1099 | .flags = INET_PROTOSW_ICSK, | 1099 | .flags = INET_PROTOSW_ICSK, |
1100 | }; | 1100 | }; |
1101 | 1101 | ||
1102 | static char dccp_v4_ctl_socket_err_msg[] __initdata = | ||
1103 | KERN_ERR "DCCP: Failed to create the control socket.\n"; | ||
1104 | |||
1105 | static int __init dccp_v4_ctl_sock_init(void) | ||
1106 | { | ||
1107 | int rc = sock_create_kern(PF_INET, SOCK_DCCP, IPPROTO_DCCP, | ||
1108 | &dccp_v4_ctl_socket); | ||
1109 | if (rc < 0) | ||
1110 | printk(dccp_v4_ctl_socket_err_msg); | ||
1111 | else { | ||
1112 | dccp_v4_ctl_socket->sk->sk_allocation = GFP_ATOMIC; | ||
1113 | inet_sk(dccp_v4_ctl_socket->sk)->uc_ttl = -1; | ||
1114 | |||
1115 | /* Unhash it so that IP input processing does not even | ||
1116 | * see it, we do not wish this socket to see incoming | ||
1117 | * packets. | ||
1118 | */ | ||
1119 | dccp_v4_ctl_socket->sk->sk_prot->unhash(dccp_v4_ctl_socket->sk); | ||
1120 | } | ||
1121 | |||
1122 | return rc; | ||
1123 | } | ||
1124 | |||
1125 | static int __init dccp_v4_init(void) | 1102 | static int __init dccp_v4_init(void) |
1126 | { | 1103 | { |
1127 | int err = proto_register(&dccp_v4_prot, 1); | 1104 | int err = proto_register(&dccp_v4_prot, 1); |
@@ -1135,7 +1112,8 @@ static int __init dccp_v4_init(void) | |||
1135 | 1112 | ||
1136 | inet_register_protosw(&dccp_v4_protosw); | 1113 | inet_register_protosw(&dccp_v4_protosw); |
1137 | 1114 | ||
1138 | err = dccp_v4_ctl_sock_init(); | 1115 | err = inet_csk_ctl_sock_create(&dccp_v4_ctl_socket, PF_INET, |
1116 | SOCK_DCCP, IPPROTO_DCCP); | ||
1139 | if (err) | 1117 | if (err) |
1140 | goto out_unregister_protosw; | 1118 | goto out_unregister_protosw; |
1141 | out: | 1119 | out: |