Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/luanetfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,18 @@ static const luaL_Reg luanetfilter_lib[] = {
static void luanetfilter_release(void *private)
{
luanetfilter_t *nf = (luanetfilter_t *)private;
if (nf->skb) {
luadata_close(nf->skb);
nf->skb = NULL;
}
if (!nf->runtime)
return;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0))
nf_unregister_net_hook(&init_net, &nf->nfops);
#else
nf_unregister_hook(&nf->nfops);
#endif
lunatik_putobject(nf->runtime);
nf->runtime = NULL;
}
Expand Down