Hi
i’m trying to port HNAT to 4.14…hangung currently on calls “nf_register_hooks” and “nf_unregister_hooks”, which are removed from netfilter.h
does anybody know, how the new way is?
int nf_register_hooks(struct nf_hook_ops *reg, unsigned int n);
void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n);
is replaced by
int nf_register_net_hooks(struct net *net, const struct nf_hook_ops *reg,
unsigned int n);
void nf_unregister_net_hooks(struct net *net, const struct nf_hook_ops *reg,
unsigned int n);
with Kernel 4.12.x (old functions still there in 4.11)
to change it i need a net-variable, but i’ve not found out how to get it…
drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c:279:int hnat_register_nf_hooks(void)
drivers/net/ethernet/mediatek/mtk_hnat/hnat.c:275: err = hnat_register_nf_hooks();
it seems it must be implemented like this (patch modified to get real function):
https://www.mail-archive.com/[email protected]/msg127372.html
int nf_register_hook(struct nf_hook_ops *reg)
{
struct net *net, *last;
int ret;
for_each_net(net) { //seems to get the net-var which is only declared above
ret = nf_register_net_hook(net, reg);
if (ret && ret != -ENOENT)
goto rollback;
}
list_add_tail(®->list, &nf_hook_list);
}
}
happy holidays
regards Frank