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: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Alexey Dobriyan and committed by David S. Miller 61e57448 485ac57b

+2 -2
+2 -2
net/netfilter/nf_conntrack_proto_gre.c
··· 335 335 rv = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_gre4); 336 336 if (rv < 0) 337 337 return rv; 338 - rv = register_pernet_gen_device(&proto_gre_net_id, &proto_gre_net_ops); 338 + rv = register_pernet_gen_subsys(&proto_gre_net_id, &proto_gre_net_ops); 339 339 if (rv < 0) 340 340 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4); 341 341 return rv; ··· 344 344 static void nf_ct_proto_gre_fini(void) 345 345 { 346 346 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4); 347 - unregister_pernet_gen_device(proto_gre_net_id, &proto_gre_net_ops); 347 + unregister_pernet_gen_subsys(proto_gre_net_id, &proto_gre_net_ops); 348 348 } 349 349 350 350 module_init(nf_ct_proto_gre_init);