aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/arptable_filter.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-02-25 10:08:35 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-03-02 20:05:23 +0100
commita67dd266adf42a24df31380e9da78390bb4d65ef (patch)
tree50c03ebc1b9c80de06e88eb7002efe5facc369af /net/ipv4/netfilter/arptable_filter.c
parent5f547391f5f25bb71f27860ad25bd1e4715f0752 (diff)
downloadlinux-a67dd266adf42a24df31380e9da78390bb4d65ef.tar.gz
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 'net/ipv4/netfilter/arptable_filter.c')
-rw-r--r--net/ipv4/netfilter/arptable_filter.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c
index 1897ee1609202..4c02416925764 100644
--- a/net/ipv4/netfilter/arptable_filter.c
+++ b/net/ipv4/netfilter/arptable_filter.c
@@ -38,19 +38,20 @@ static struct nf_hook_ops *arpfilter_ops __read_mostly;
static int __net_init arptable_filter_net_init(struct net *net)
{
struct arpt_replace *repl;
-
+ int err;
+
repl = arpt_alloc_initial_table(&packet_filter);
if (repl == NULL)
return -ENOMEM;
- net->ipv4.arptable_filter =
- arpt_register_table(net, &packet_filter, repl);
+ err = arpt_register_table(net, &packet_filter, repl, arpfilter_ops,
+ &net->ipv4.arptable_filter);
kfree(repl);
- return PTR_ERR_OR_ZERO(net->ipv4.arptable_filter);
+ return err;
}
static void __net_exit arptable_filter_net_exit(struct net *net)
{
- arpt_unregister_table(net->ipv4.arptable_filter);
+ arpt_unregister_table(net, net->ipv4.arptable_filter, arpfilter_ops);
}
static struct pernet_operations arptable_filter_net_ops = {