summaryrefslogtreecommitdiffstats
path: root/iptables/nft.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-05-05 16:01:29 +0200
committerPhil Sutter <phil@nwl.cc>2023-08-11 15:56:38 +0200
commit402b9b3c07c8192be3bfc0191fbf56401e26a003 (patch)
treee9ad98d8b47a739f314931e82436b05248ed192d /iptables/nft.c
parent2d6221641d66b502b1a49d3267bd8126b0448a1d (diff)
nft: Pass nft_handle to add_{target,action}()
Prepare for varying rule content based on a global flag. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft.c')
-rw-r--r--iptables/nft.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index 97fd4f49..1fc12b0c 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -1538,7 +1538,8 @@ static int add_meta_nftrace(struct nftnl_rule *r)
return 0;
}
-int add_target(struct nftnl_rule *r, struct xt_entry_target *t)
+int add_target(struct nft_handle *h, struct nftnl_rule *r,
+ struct xt_entry_target *t)
{
struct nftnl_expr *expr;
int ret;
@@ -1587,8 +1588,8 @@ int add_verdict(struct nftnl_rule *r, int verdict)
return 0;
}
-int add_action(struct nftnl_rule *r, struct iptables_command_state *cs,
- bool goto_set)
+int add_action(struct nft_handle *h, struct nftnl_rule *r,
+ struct iptables_command_state *cs, bool goto_set)
{
int ret = 0;
@@ -1604,7 +1605,7 @@ int add_action(struct nftnl_rule *r, struct iptables_command_state *cs,
else if (strcmp(cs->jumpto, "NFLOG") == 0)
ret = add_log(r, cs);
else
- ret = add_target(r, cs->target->t);
+ ret = add_target(h, r, cs->target->t);
} else if (strlen(cs->jumpto) > 0) {
/* Not standard, then it's a go / jump to chain */
if (goto_set)