Commit 61e57448 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller

netfilter: nf_conntrack_proto_gre: switch to register_pernet_gen_subsys()

register_pernet_gen_device() can't be used is nf_conntrack_pptp module is
also used (compiled in or loaded).

Right now, proto_gre_net_exit() is called before nf_conntrack_pptp_net_exit().
The former shutdowns and frees GRE piece of netns, however the latter
absolutely needs it to flush keymap. Oops is inevitable.

Switch to shiny new register_pernet_gen_subsys() to get correct ordering in
netns ops list.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 485ac57b
...@@ -335,7 +335,7 @@ static int __init nf_ct_proto_gre_init(void) ...@@ -335,7 +335,7 @@ static int __init nf_ct_proto_gre_init(void)
rv = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_gre4); rv = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_gre4);
if (rv < 0) if (rv < 0)
return rv; return rv;
rv = register_pernet_gen_device(&proto_gre_net_id, &proto_gre_net_ops); rv = register_pernet_gen_subsys(&proto_gre_net_id, &proto_gre_net_ops);
if (rv < 0) if (rv < 0)
nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4); nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4);
return rv; return rv;
...@@ -344,7 +344,7 @@ static int __init nf_ct_proto_gre_init(void) ...@@ -344,7 +344,7 @@ static int __init nf_ct_proto_gre_init(void)
static void nf_ct_proto_gre_fini(void) static void nf_ct_proto_gre_fini(void)
{ {
nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4); nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4);
unregister_pernet_gen_device(proto_gre_net_id, &proto_gre_net_ops); unregister_pernet_gen_subsys(proto_gre_net_id, &proto_gre_net_ops);
} }
module_init(nf_ct_proto_gre_init); module_init(nf_ct_proto_gre_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment