From 80e1d5cba738d0b9b7f5ffab8e5e7d02d6b06eeb Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 22 Jul 2019 12:16:22 +0200 Subject: nft: Make nft_for_each_table() more versatile Support passing arbitrary data (via void pointer) to the callback. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- iptables/nft.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'iptables/nft.c') 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); } -- cgit v1.2.3