From 2ce9f65a374bad212899bc584d3e5f4698df6fc6 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sat, 4 Aug 2018 13:10:19 +0200 Subject: xtables: Match verbose ip{,6}tables output with legacy Legacy ip{,6}tables prints feedback for various commands if in verbose mode, make sure nft variants do the same. There is one difference, namely when checking a rule (-C command): Legacy ip{,6}tables print the rule in any case, nft variants don't in case the rule wasn't found. Changing this though would require to populate the nftnl_rule object just for printing, which is probably not feasible. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal --- iptables/xtables-arp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'iptables/xtables-arp.c') diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c index 28f449e8..62282f42 100644 --- a/iptables/xtables-arp.c +++ b/iptables/xtables-arp.c @@ -1421,10 +1421,11 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table) options&OPT_LINENUMBERS); break; case CMD_FLUSH: - ret = nft_rule_flush(h, chain, *table); + ret = nft_rule_flush(h, chain, *table, options & OPT_VERBOSE); break; case CMD_ZERO: - ret = nft_chain_zero_counters(h, chain, *table); + ret = nft_chain_zero_counters(h, chain, *table, + options & OPT_VERBOSE); break; case CMD_LIST|CMD_ZERO: ret = list_entries(h, chain, *table, rulenum, @@ -1433,13 +1434,15 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table) /*options&OPT_EXPANDED*/0, options&OPT_LINENUMBERS); if (ret) - ret = nft_chain_zero_counters(h, chain, *table); + ret = nft_chain_zero_counters(h, chain, *table, + options & OPT_VERBOSE); break; case CMD_NEW_CHAIN: ret = nft_chain_user_add(h, chain, *table); break; case CMD_DELETE_CHAIN: - ret = nft_chain_user_del(h, chain, *table); + ret = nft_chain_user_del(h, chain, *table, + options & OPT_VERBOSE); break; case CMD_RENAME_CHAIN: ret = nft_chain_user_rename(h, chain, *table, newname); -- cgit v1.2.3