summaryrefslogtreecommitdiffstats
path: root/iptables/nft.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-07-19 18:32:06 +0200
committerFlorian Westphal <fw@strlen.de>2018-07-19 23:11:32 +0200
commit6f60f22c488675ef9c9e02ca4abc9dc0b210f6a6 (patch)
treede0ce81254326509971c1bc27456d754ecca53e2 /iptables/nft.c
parentf3b772c10b782196060fe39ca6da142ba75e43d9 (diff)
xtables: pass format to nft_rule_save()
Preparing ebtables-save implementation, allow for callers to pass format bits to nft_rule_save() instead of just the 'counters' boolean. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/nft.c')
-rw-r--r--iptables/nft.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index 9f650f5a..07e15c7a 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -1373,7 +1373,7 @@ retry:
return list;
}
-int nft_rule_save(struct nft_handle *h, const char *table, bool counters)
+int nft_rule_save(struct nft_handle *h, const char *table, unsigned int format)
{
struct nftnl_rule_list *list;
struct nftnl_rule_list_iter *iter;
@@ -1395,8 +1395,7 @@ int nft_rule_save(struct nft_handle *h, const char *table, bool counters)
if (strcmp(table, rule_table) != 0)
goto next;
- nft_rule_print_save(r, NFT_RULE_APPEND,
- counters ? 0 : FMT_NOCOUNTS);
+ nft_rule_print_save(r, NFT_RULE_APPEND, format);
next:
r = nftnl_rule_list_iter_next(iter);