|
@@ -1792,6 +1792,8 @@ int ip6t_register_table(struct net *net, const struct xt_table *table,
|
|
|
|
|
|
/* set res now, will see skbs right after nf_register_net_hooks */
|
|
|
WRITE_ONCE(*res, new_table);
|
|
|
+ if (!ops)
|
|
|
+ return 0;
|
|
|
|
|
|
ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks));
|
|
|
if (ret != 0) {
|
|
@@ -1809,7 +1811,8 @@ out_free:
|
|
|
void ip6t_unregister_table(struct net *net, struct xt_table *table,
|
|
|
const struct nf_hook_ops *ops)
|
|
|
{
|
|
|
- nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
|
|
|
+ if (ops)
|
|
|
+ nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
|
|
|
__ip6t_unregister_table(net, table);
|
|
|
}
|
|
|
|