summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-06-12 19:27:37 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-06-13 12:39:53 +0200
commitcc1ea7ef36868c0708741392c99fcd2f2c395131 (patch)
tree51f502d51923de535f82233a79361120e409c852 /src/rule.c
parent8358ee1bf3236f0d2b1ccfdcf7d31cd7063815a5 (diff)
monitor: Accept -j flag
Make 'nft -j monitor' equal to 'nft monitor json' and change documentation to use only the first variant since that is more intuitive and also consistent with other commands. While being at it, drop references to XML from monitor section - it was never supported. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index 7eb89a00..8de5aa62 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -2435,6 +2435,9 @@ static int do_command_monitor(struct netlink_ctx *ctx, struct cmd *cmd)
.debug_mask = ctx->nft->debug_mask,
};
+ if (nft_output_json(&ctx->nft->output))
+ monhandler.format = NFTNL_OUTPUT_JSON;
+
monhandler.cache_needed = need_cache(cmd);
if (monhandler.cache_needed) {
struct rule *rule, *nrule;