summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGopal Yadav <gopunop@gmail.com>2020-09-22 13:55:33 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2020-09-22 23:26:18 +0200
commitf02aa3764a48c2afd17761a211f70da941c71d00 (patch)
treeeebe5a578a3aa3c11cd6f7403bc9b1aede9f69a5 /src
parentae1d822630e6dcbac2650a90b2004360d7a51e48 (diff)
json: Combining --terse with --json has no effect
--terse with --json is ignored, fix this. This patch also includes a test. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1388 Signed-off-by: Gopal Yadav <gopunop@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c
index a9f5000f..5856f9fc 100644
--- a/src/json.c
+++ b/src/json.c
@@ -140,7 +140,7 @@ static json_t *set_print_json(struct output_ctx *octx, const struct set *set)
json_object_set_new(root, "gc-interval", tmp);
}
- if (set->init && set->init->size > 0) {
+ if (!nft_output_terse(octx) && set->init && set->init->size > 0) {
json_t *array = json_array();
const struct expr *i;