aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/ipv6.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index b657dea9ee27..2ca52913f4be 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1171,6 +1171,20 @@ static struct inet_protosw dccp_v6_protosw = {
1171 .flags = INET_PROTOSW_ICSK, 1171 .flags = INET_PROTOSW_ICSK,
1172}; 1172};
1173 1173
1174static int dccp_v6_init_net(struct net *net)
1175{
1176 return 0;
1177}
1178
1179static void dccp_v6_exit_net(struct net *net)
1180{
1181}
1182
1183static struct pernet_operations dccp_v6_ops = {
1184 .init = dccp_v6_init_net,
1185 .exit = dccp_v6_exit_net,
1186};
1187
1174static int __init dccp_v6_init(void) 1188static int __init dccp_v6_init(void)
1175{ 1189{
1176 int err = proto_register(&dccp_v6_prot, 1); 1190 int err = proto_register(&dccp_v6_prot, 1);
@@ -1188,8 +1202,15 @@ static int __init dccp_v6_init(void)
1188 SOCK_DCCP, IPPROTO_DCCP, &init_net); 1202 SOCK_DCCP, IPPROTO_DCCP, &init_net);
1189 if (err != 0) 1203 if (err != 0)
1190 goto out_unregister_protosw; 1204 goto out_unregister_protosw;
1205
1206 err = register_pernet_subsys(&dccp_v6_ops);
1207 if (err != 0)
1208 goto out_destroy_ctl_sock;
1191out: 1209out:
1192 return err; 1210 return err;
1211
1212out_destroy_ctl_sock:
1213 inet_ctl_sock_destroy(dccp_v6_ctl_sk);
1193out_unregister_protosw: 1214out_unregister_protosw:
1194 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP); 1215 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
1195 inet6_unregister_protosw(&dccp_v6_protosw); 1216 inet6_unregister_protosw(&dccp_v6_protosw);
@@ -1200,6 +1221,7 @@ out_unregister_proto:
1200 1221
1201static void __exit dccp_v6_exit(void) 1222static void __exit dccp_v6_exit(void)
1202{ 1223{
1224 unregister_pernet_subsys(&dccp_v6_ops);
1203 inet_ctl_sock_destroy(dccp_v6_ctl_sk); 1225 inet_ctl_sock_destroy(dccp_v6_ctl_sk);
1204 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP); 1226 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
1205 inet6_unregister_protosw(&dccp_v6_protosw); 1227 inet6_unregister_protosw(&dccp_v6_protosw);