Loading net/key/af_key.c +27 −8 Original line number Original line Diff line number Diff line Loading @@ -3782,6 +3782,29 @@ static int pfkey_read_proc(char *buffer, char **start, off_t offset, return len; return len; } } static int pfkey_init_proc(void) { if (create_proc_read_entry("pfkey", 0, init_net.proc_net, pfkey_read_proc, NULL) == NULL) return -ENOMEM; else return 0; } static void pfkey_exit_proc(void) { remove_proc_entry("net/pfkey", NULL); } #else static inline int pfkey_init_proc(void) { return 0; } static inline void pfkey_exit_proc(void) { } #endif #endif static struct xfrm_mgr pfkeyv2_mgr = static struct xfrm_mgr pfkeyv2_mgr = Loading @@ -3798,7 +3821,7 @@ static struct xfrm_mgr pfkeyv2_mgr = static void __exit ipsec_pfkey_exit(void) static void __exit ipsec_pfkey_exit(void) { { xfrm_unregister_km(&pfkeyv2_mgr); xfrm_unregister_km(&pfkeyv2_mgr); remove_proc_entry("pfkey", init_net.proc_net); pfkey_exit_proc(); sock_unregister(PF_KEY); sock_unregister(PF_KEY); proto_unregister(&key_proto); proto_unregister(&key_proto); } } Loading @@ -3813,21 +3836,17 @@ static int __init ipsec_pfkey_init(void) err = sock_register(&pfkey_family_ops); err = sock_register(&pfkey_family_ops); if (err != 0) if (err != 0) goto out_unregister_key_proto; goto out_unregister_key_proto; #ifdef CONFIG_PROC_FS err = pfkey_init_proc(); err = -ENOMEM; if (err != 0) if (create_proc_read_entry("pfkey", 0, init_net.proc_net, pfkey_read_proc, NULL) == NULL) goto out_sock_unregister; goto out_sock_unregister; #endif err = xfrm_register_km(&pfkeyv2_mgr); err = xfrm_register_km(&pfkeyv2_mgr); if (err != 0) if (err != 0) goto out_remove_proc_entry; goto out_remove_proc_entry; out: out: return err; return err; out_remove_proc_entry: out_remove_proc_entry: #ifdef CONFIG_PROC_FS pfkey_exit_proc(); remove_proc_entry("net/pfkey", NULL); out_sock_unregister: out_sock_unregister: #endif sock_unregister(PF_KEY); sock_unregister(PF_KEY); out_unregister_key_proto: out_unregister_key_proto: proto_unregister(&key_proto); proto_unregister(&key_proto); Loading Loading
net/key/af_key.c +27 −8 Original line number Original line Diff line number Diff line Loading @@ -3782,6 +3782,29 @@ static int pfkey_read_proc(char *buffer, char **start, off_t offset, return len; return len; } } static int pfkey_init_proc(void) { if (create_proc_read_entry("pfkey", 0, init_net.proc_net, pfkey_read_proc, NULL) == NULL) return -ENOMEM; else return 0; } static void pfkey_exit_proc(void) { remove_proc_entry("net/pfkey", NULL); } #else static inline int pfkey_init_proc(void) { return 0; } static inline void pfkey_exit_proc(void) { } #endif #endif static struct xfrm_mgr pfkeyv2_mgr = static struct xfrm_mgr pfkeyv2_mgr = Loading @@ -3798,7 +3821,7 @@ static struct xfrm_mgr pfkeyv2_mgr = static void __exit ipsec_pfkey_exit(void) static void __exit ipsec_pfkey_exit(void) { { xfrm_unregister_km(&pfkeyv2_mgr); xfrm_unregister_km(&pfkeyv2_mgr); remove_proc_entry("pfkey", init_net.proc_net); pfkey_exit_proc(); sock_unregister(PF_KEY); sock_unregister(PF_KEY); proto_unregister(&key_proto); proto_unregister(&key_proto); } } Loading @@ -3813,21 +3836,17 @@ static int __init ipsec_pfkey_init(void) err = sock_register(&pfkey_family_ops); err = sock_register(&pfkey_family_ops); if (err != 0) if (err != 0) goto out_unregister_key_proto; goto out_unregister_key_proto; #ifdef CONFIG_PROC_FS err = pfkey_init_proc(); err = -ENOMEM; if (err != 0) if (create_proc_read_entry("pfkey", 0, init_net.proc_net, pfkey_read_proc, NULL) == NULL) goto out_sock_unregister; goto out_sock_unregister; #endif err = xfrm_register_km(&pfkeyv2_mgr); err = xfrm_register_km(&pfkeyv2_mgr); if (err != 0) if (err != 0) goto out_remove_proc_entry; goto out_remove_proc_entry; out: out: return err; return err; out_remove_proc_entry: out_remove_proc_entry: #ifdef CONFIG_PROC_FS pfkey_exit_proc(); remove_proc_entry("net/pfkey", NULL); out_sock_unregister: out_sock_unregister: #endif sock_unregister(PF_KEY); sock_unregister(PF_KEY); out_unregister_key_proto: out_unregister_key_proto: proto_unregister(&key_proto); proto_unregister(&key_proto); Loading