From d4d319cb0afdce06fb5e3fad5fe1cff4232bdbd6 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 20 Aug 2019 15:15:19 +0200 Subject: nft: family_ops: Pass nft_handle to 'add' callback In order for add_match() to create anonymous sets when converting xtables matches it needs access to nft handle. So pass it along from callers of family ops' add callback. Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/nft.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'iptables/nft.c') diff --git a/iptables/nft.c b/iptables/nft.c index 599c2f7e..e31f2834 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -930,7 +930,8 @@ static int add_nft_limit(struct nftnl_rule *r, struct xt_entry_match *m) return 0; } -int add_match(struct nftnl_rule *r, struct xt_entry_match *m) +int add_match(struct nft_handle *h, + struct nftnl_rule *r, struct xt_entry_match *m) { struct nftnl_expr *expr; int ret; @@ -1152,7 +1153,7 @@ nft_rule_new(struct nft_handle *h, const char *chain, const char *table, nftnl_rule_set_str(r, NFTNL_RULE_TABLE, table); nftnl_rule_set_str(r, NFTNL_RULE_CHAIN, chain); - if (h->ops->add(r, data) < 0) + if (h->ops->add(h, r, data) < 0) goto err; return r; -- cgit v1.2.3