summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-08-07 12:29:35 +0200
committerFlorian Westphal <fw@strlen.de>2018-08-09 22:56:36 +0200
commit528cbf99ff6062420270e637df4d40a77514fe56 (patch)
tree7055aa1c7a02a8c314b7559781118786ee574c8b /include
parent9ca32c40ed4f0648893989c1e5d03e9fecc501ae (diff)
xtables: Fix for wrong counter format in -S output
Legacy iptables uses '-c PCNT BCNT' format in listed rules, nft-variant used '[PCNT BCNT]' prefix like with iptables-save. In order to pass the counter format preference along, FMT_C_COUNTS is introduced and related 'format' checks adjusted. Since legacy iptables prints the counters between matches and target, this change affects save_matches_and_target() function. In order to get access to the rule counters, it's declaration is adjusted to receive iptables_command_state pointer instead of match, target and jumpto pointers from the same object. While being at it, integrate jump to user-defined chain into it as well since the related code in both callers was almost identical. Though since different rule flags are used between iptables and ip6tables, pass a 'goto_flag' boolean instead of the actual 'flags' bitfield. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
-rw-r--r--include/xtables.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/xtables.h b/include/xtables.h
index e4d23502..bf169b08 100644
--- a/include/xtables.h
+++ b/include/xtables.h
@@ -537,6 +537,7 @@ extern void xtables_save_string(const char *value);
#define FMT_NONEWLINE 0x0080
#define FMT_LINENUMBERS 0x0100
#define FMT_EBT_SAVE 0x0200
+#define FMT_C_COUNTS 0x0400
#define FMT_PRINT_RULE (FMT_NOCOUNTS | FMT_OPTIONS | FMT_VIA \
| FMT_NUMERIC | FMT_NOTABLE)