From db3a63237fe21de8a75eaaddf0cc577ce30a68fe Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 8 Jul 2020 15:18:48 +0200 Subject: nft: Turn nft_chain_save() into a foreach-callback Let nftnl_chain_list_foreach() do the chain list iterating instead of open-coding it. While being at it, simplify the policy value selection code as well. Signed-off-by: Phil Sutter --- iptables/xtables-save.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/xtables-save.c') diff --git a/iptables/xtables-save.c b/iptables/xtables-save.c index bb3d8cd3..92b0c911 100644 --- a/iptables/xtables-save.c +++ b/iptables/xtables-save.c @@ -92,7 +92,7 @@ __do_output(struct nft_handle *h, const char *tablename, void *data) printf("*%s\n", tablename); /* Dump out chain names first, * thereby preventing dependency conflicts */ - nft_chain_save(h, chain_list); + nftnl_chain_list_foreach(chain_list, nft_chain_save, h); nft_rule_save(h, tablename, d->format); if (d->commit) printf("COMMIT\n"); -- cgit v1.2.3