So we don't forget all these caches should be placed into struct
nft_ctx.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
void devgroup_table_init(void);
void realm_table_meta_init(void);
void xt_init(void);
-void nft_init(void);
void ct_label_table_exit(void);
void mark_table_exit(void);
void realm_table_meta_exit(void);
void devgroup_table_exit(void);
void realm_table_rt_exit(void);
-void nft_exit(void);
#endif /* NFTABLES_NFTABLES_H */
return ret;
}
-void nft_init(void)
+static void nft_init(void)
{
mark_table_init();
realm_table_rt_init();
#endif
}
-void nft_exit(void)
+static void nft_exit(void)
{
ct_label_table_exit();
realm_table_rt_exit();
{
struct nft_ctx *ctx;
+ nft_init();
ctx = xzalloc(sizeof(struct nft_ctx));
ctx->include_paths[0] = DEFAULT_INCLUDE_PATH;
iface_cache_release();
cache_release(&nft->cache);
xfree(ctx);
+ nft_exit();
}
static int nft_run_cmd_from_buffer(struct nft_ctx *nft,
struct parser_state state;
int i, val, rc;
- nft_init();
-
nft = nft_ctx_new();
nf_sock = netlink_open_sock();
xfree(buf);
netlink_close_sock(nf_sock);
nft_ctx_free(nft);
- nft_exit();
return rc;
}