summaryrefslogtreecommitdiffstats
path: root/src/xt.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-05-05 20:12:46 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-05-05 20:21:27 +0200
commitd0d564ed1fba00cc3b2fdf4d646f080b2790b76a (patch)
tree698d17c51a94b3d82512b7ce1608a505a6e649ea /src/xt.c
parenteea03c8fb560a8a6deede1bccbce78b52b2c2905 (diff)
src: add rule_stmt_append() and use it
This helper function adds a statement at the end of the rule statement list and it updates the rule statement counter. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/xt.c')
-rw-r--r--src/xt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xt.c b/src/xt.c
index b0f5a30c..f39acf30 100644
--- a/src/xt.c
+++ b/src/xt.c
@@ -238,7 +238,7 @@ void netlink_parse_match(struct netlink_parse_ctx *ctx,
stmt->xt.name = strdup(name);
stmt->xt.type = NFT_XT_MATCH;
#endif
- list_add_tail(&stmt->list, &ctx->rule->stmts);
+ rule_stmt_append(ctx->rule, stmt);
}
void netlink_parse_target(struct netlink_parse_ctx *ctx,
@@ -283,7 +283,7 @@ void netlink_parse_target(struct netlink_parse_ctx *ctx,
stmt->xt.name = strdup(name);
stmt->xt.type = NFT_XT_TARGET;
#endif
- list_add_tail(&stmt->list, &ctx->rule->stmts);
+ rule_stmt_append(ctx->rule, stmt);
}
#ifdef HAVE_LIBXTABLES