mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 08:18:47 +00:00
netfilter: decnet: only register hooks in init namespace
looks like decnet isn't namespacified in first place, so restrict hook registration to the initial namespace. Prepares for eventual removal of legacy nf_register_hook() api. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
efe4160618
commit
1a0ed0ad48
@ -134,7 +134,7 @@ static int __init dn_rtmsg_init(void)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = nf_register_hook(&dnrmg_ops);
|
rv = nf_register_net_hook(&init_net, &dnrmg_ops);
|
||||||
if (rv) {
|
if (rv) {
|
||||||
netlink_kernel_release(dnrmg);
|
netlink_kernel_release(dnrmg);
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ static int __init dn_rtmsg_init(void)
|
|||||||
|
|
||||||
static void __exit dn_rtmsg_fini(void)
|
static void __exit dn_rtmsg_fini(void)
|
||||||
{
|
{
|
||||||
nf_unregister_hook(&dnrmg_ops);
|
nf_unregister_net_hook(&init_net, &dnrmg_ops);
|
||||||
netlink_kernel_release(dnrmg);
|
netlink_kernel_release(dnrmg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user