From d0d564ed1fba00cc3b2fdf4d646f080b2790b76a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 5 May 2020 20:12:46 +0200 Subject: 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 --- src/xt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xt.c') 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 -- cgit v1.2.3