diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ipv4.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index b12803bcba56..10bba039c4b8 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -989,6 +989,20 @@ static struct inet_protosw dccp_v4_protosw = { | |||
989 | .flags = INET_PROTOSW_ICSK, | 989 | .flags = INET_PROTOSW_ICSK, |
990 | }; | 990 | }; |
991 | 991 | ||
992 | static int dccp_v4_init_net(struct net *net) | ||
993 | { | ||
994 | return 0; | ||
995 | } | ||
996 | |||
997 | static void dccp_v4_exit_net(struct net *net) | ||
998 | { | ||
999 | } | ||
1000 | |||
1001 | static struct pernet_operations dccp_v4_ops = { | ||
1002 | .init = dccp_v4_init_net, | ||
1003 | .exit = dccp_v4_exit_net, | ||
1004 | }; | ||
1005 | |||
992 | static int __init dccp_v4_init(void) | 1006 | static int __init dccp_v4_init(void) |
993 | { | 1007 | { |
994 | int err = proto_register(&dccp_v4_prot, 1); | 1008 | int err = proto_register(&dccp_v4_prot, 1); |
@@ -1006,8 +1020,14 @@ static int __init dccp_v4_init(void) | |||
1006 | SOCK_DCCP, IPPROTO_DCCP, &init_net); | 1020 | SOCK_DCCP, IPPROTO_DCCP, &init_net); |
1007 | if (err) | 1021 | if (err) |
1008 | goto out_unregister_protosw; | 1022 | goto out_unregister_protosw; |
1023 | |||
1024 | err = register_pernet_subsys(&dccp_v4_ops); | ||
1025 | if (err) | ||
1026 | goto out_destroy_ctl_sock; | ||
1009 | out: | 1027 | out: |
1010 | return err; | 1028 | return err; |
1029 | out_destroy_ctl_sock: | ||
1030 | inet_ctl_sock_destroy(dccp_v4_ctl_sk); | ||
1011 | out_unregister_protosw: | 1031 | out_unregister_protosw: |
1012 | inet_unregister_protosw(&dccp_v4_protosw); | 1032 | inet_unregister_protosw(&dccp_v4_protosw); |
1013 | inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); | 1033 | inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); |
@@ -1018,6 +1038,7 @@ out_proto_unregister: | |||
1018 | 1038 | ||
1019 | static void __exit dccp_v4_exit(void) | 1039 | static void __exit dccp_v4_exit(void) |
1020 | { | 1040 | { |
1041 | unregister_pernet_subsys(&dccp_v4_ops); | ||
1021 | inet_ctl_sock_destroy(dccp_v4_ctl_sk); | 1042 | inet_ctl_sock_destroy(dccp_v4_ctl_sk); |
1022 | inet_unregister_protosw(&dccp_v4_protosw); | 1043 | inet_unregister_protosw(&dccp_v4_protosw); |
1023 | inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); | 1044 | inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); |