Florian Westphal 99afd62d48 src: fix double free on xt stmt destruction
'nft monitor' dies with:
*** Error in `/sbin/nft': double free or corruption (fasttop): 0x000055f8ba57b750 ***

... when the iptables-nft test suite is running in parallel, because
xfree(stmt->xt.name) gets called twice.

Fixes: 4ac11b890fe870 ("src: missing destroy function in statement definitions")
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
2019-05-01 18:30:23 +02:00

30 lines
801 B
C

#ifndef _NFT_XT_H_
#define _NFT_XT_H_
struct netlink_linearize_ctx;
struct netlink_parse_ctx;
struct nftnl_expr;
struct rule_pp_ctx;
struct rule;
struct output_ctx;
void xt_stmt_xlate(const struct stmt *stmt, struct output_ctx *octx);
void xt_stmt_destroy(struct stmt *stmt);
void netlink_parse_target(struct netlink_parse_ctx *ctx,
const struct location *loc,
const struct nftnl_expr *nle);
void netlink_parse_match(struct netlink_parse_ctx *ctx,
const struct location *loc,
const struct nftnl_expr *nle);
#ifdef HAVE_LIBXTABLES
void stmt_xt_postprocess(struct rule_pp_ctx *rctx, struct stmt *stmt,
struct rule *rule);
#else
static inline void stmt_xt_postprocess(struct rule_pp_ctx *rctx,
struct stmt *stmt, struct rule *rule) {}
#endif
#endif /* _NFT_XT_H_ */