diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-01-20 13:38:55 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-01-20 13:41:48 +0100 |
commit | b4c7117ef552d0d71bde1db4a047b4c005699951 (patch) | |
tree | 38f7bb844b7a253268f2b1085119d9e2a57d915d /src/statement.c | |
parent | 557936d4f9e836c7f952ab11312f1915001ed774 (diff) |
Revert ("src: Remove xt_stmt_() functions").
Revert commit bce55916b51ec1a4c23322781e3b0c698ecc9561, we need this
code in place to properly make translation when iptables-compat loads
rules.
Reported-by: Duncan Roe <duncan_roe@optusnet.com.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/statement.c')
-rw-r--r-- | src/statement.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c index 1f93260b..701337d7 100644 --- a/src/statement.c +++ b/src/statement.c @@ -694,3 +694,26 @@ struct stmt *fwd_stmt_alloc(const struct location *loc) return stmt_alloc(loc, &fwd_stmt_ops); } +static void xt_stmt_print(const struct stmt *stmt, struct output_ctx *octx) +{ + xt_stmt_xlate(stmt); +} + +static void xt_stmt_destroy(struct stmt *stmt) +{ + xfree(stmt->xt.name); + xfree(stmt->xt.opts); + xt_stmt_release(stmt); +} + +static const struct stmt_ops xt_stmt_ops = { + .type = STMT_XT, + .name = "xt", + .print = xt_stmt_print, + .destroy = xt_stmt_destroy, +}; + +struct stmt *xt_stmt_alloc(const struct location *loc) +{ + return stmt_alloc(loc, &xt_stmt_ops); +} |