summaryrefslogtreecommitdiffstats
path: root/iptables/nft.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-07-22 12:16:22 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-07-23 21:14:40 +0200
commit80e1d5cba738d0b9b7f5ffab8e5e7d02d6b06eeb (patch)
treeef240fd4db6a7c93aa92453eda2bf6e84a2381bb /iptables/nft.c
parent9449b90ec24cd71c4fe4212ed4970074e54dfa8a (diff)
nft: Make nft_for_each_table() more versatile
Support passing arbitrary data (via void pointer) to the callback. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft.c')
-rw-r--r--iptables/nft.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index 8f0d5e66..cd42af70 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -2092,8 +2092,8 @@ err:
}
int nft_for_each_table(struct nft_handle *h,
- int (*func)(struct nft_handle *h, const char *tablename, bool counters),
- bool counters)
+ int (*func)(struct nft_handle *h, const char *tablename, void *data),
+ void *data)
{
struct nftnl_table_list *list;
struct nftnl_table_list_iter *iter;
@@ -2112,7 +2112,7 @@ int nft_for_each_table(struct nft_handle *h,
const char *tablename =
nftnl_table_get(t, NFTNL_TABLE_NAME);
- func(h, tablename, counters);
+ func(h, tablename, data);
t = nftnl_table_list_iter_next(iter);
}