@@ -725,25 +725,18 @@ int rpl_ip_defrag(struct net *net, struct sk_buff *skb, u32 user)
return -ENOMEM;
}
-static int __net_init ipv4_frags_init_net(struct net *net)
-{
- nf_defrag_ipv4_enable();
-
- return 0;
-}
-
static void __net_exit ipv4_frags_exit_net(struct net *net)
{
inet_frags_exit_net(&net->ipv4.frags, &ip4_frags);
}
static struct pernet_operations ip4_frags_ops = {
- .init = ipv4_frags_init_net,
.exit = ipv4_frags_exit_net,
};
int __init rpl_ipfrag_init(void)
{
+ nf_defrag_ipv4_enable();
register_pernet_subsys(&ip4_frags_ops);
ip4_frags.hashfn = ip4_hashfn;
ip4_frags.constructor = ip4_frag_init;
@@ -556,20 +556,12 @@ out_unlock:
return ret;
}
-static int nf_ct_net_init(struct net *net)
-{
- nf_defrag_ipv6_enable();
-
- return 0;
-}
-
static void nf_ct_net_exit(struct net *net)
{
inet_frags_exit_net(&net->nf_frag.frags, &nf_frags);
}
static struct pernet_operations nf_ct_net_ops = {
- .init = nf_ct_net_init,
.exit = nf_ct_net_exit,
};
@@ -577,6 +569,7 @@ int rpl_nf_ct_frag6_init(void)
{
int ret = 0;
+ nf_defrag_ipv6_enable();
nf_frags.hashfn = nf_hashfn;
nf_frags.constructor = ip6_frag_init;
nf_frags.destructor = NULL;
This function is just a dummy to ensure that the corresponding netfilter fragment module is loaded, to initialize the shared structures. But it doesn't need to be invoked once per namespace; one call per protocol should do the trick. Signed-off-by: Joe Stringer <joe@ovn.org> --- datapath/linux/compat/ip_fragment.c | 9 +-------- datapath/linux/compat/nf_conntrack_reasm.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-)