diff options
author | Florian Westphal <fw@strlen.de> | 2016-02-25 10:08:35 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-03-02 20:05:23 +0100 |
commit | a67dd266adf42a24df31380e9da78390bb4d65ef (patch) | |
tree | 50c03ebc1b9c80de06e88eb7002efe5facc369af /net/ipv6/netfilter/ip6table_security.c | |
parent | netfilter: nf_defrag_ipv4: Drop redundant ip_send_check() (diff) | |
download | linux-dev-a67dd266adf42a24df31380e9da78390bb4d65ef.tar.xz linux-dev-a67dd266adf42a24df31380e9da78390bb4d65ef.zip |
netfilter: xtables: prepare for on-demand hook register
This change prepares for upcoming on-demand xtables hook registration.
We change the protoypes of the register/unregister functions.
A followup patch will then add nf_hook_register/unregister calls
to the iptables one.
Once a hook is registered packets will be picked up, so all assignments
of the form
net->ipv4.iptable_$table = new_table
have to be moved to ip(6)t_register_table, else we can see NULL
net->ipv4.iptable_$table later.
This patch doesn't change functionality; without this the actual change
simply gets too big.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to '')
-rw-r--r-- | net/ipv6/netfilter/ip6table_security.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c index 0d856fedfeb0..cf587453e322 100644 --- a/net/ipv6/netfilter/ip6table_security.c +++ b/net/ipv6/netfilter/ip6table_security.c @@ -47,19 +47,20 @@ static struct nf_hook_ops *sectbl_ops __read_mostly; static int __net_init ip6table_security_net_init(struct net *net) { struct ip6t_replace *repl; + int ret; repl = ip6t_alloc_initial_table(&security_table); if (repl == NULL) return -ENOMEM; - net->ipv6.ip6table_security = - ip6t_register_table(net, &security_table, repl); + ret = ip6t_register_table(net, &security_table, repl, sectbl_ops, + &net->ipv6.ip6table_security); kfree(repl); - return PTR_ERR_OR_ZERO(net->ipv6.ip6table_security); + return ret; } static void __net_exit ip6table_security_net_exit(struct net *net) { - ip6t_unregister_table(net, net->ipv6.ip6table_security); + ip6t_unregister_table(net, net->ipv6.ip6table_security, sectbl_ops); } static struct pernet_operations ip6table_security_net_ops = { |