From b81519f1641b508c289ddfefc800b2c20ab243e6 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 8 May 2020 14:44:02 +0200 Subject: libnftables: call nft_cmd_expand() only with CMD_ADD Restrict the expansion logic to the CMD_ADD command which is where this is only required. Signed-off-by: Pablo Neira Ayuso --- src/libnftables.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libnftables.c b/src/libnftables.c index 32da0a29..668e3fc4 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -419,8 +419,12 @@ static int nft_evaluate(struct nft_ctx *nft, struct list_head *msgs, if (nft->state->nerrs) return -1; - list_for_each_entry(cmd, cmds, list) + list_for_each_entry(cmd, cmds, list) { + if (cmd->op != CMD_ADD) + continue; + nft_cmd_expand(cmd); + } return 0; } -- cgit v1.2.3