From 90ed4fb3855f0d9d881b812c75e338e5e93081ba Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 11 Oct 2018 17:48:59 +0200 Subject: monitor: Fix printing of ct objects Monitor output is supposed to be single lined without tabs, but ct object were printed with newlines and tabs hard-coded. Fixing this wasn't too hard given that there is 'stmt_separator' to also include semi-colons where required if newline was removed. A more obvious mistake was position of object type in monitor output: Like with other object types, it has to occur between command and table spec. As a positive side-effect, this aligns ct objects better with others (see obj_type_name_array for instance). Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/json.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/json.c') diff --git a/src/json.c b/src/json.c index b8d9333e..a0a2b9db 100644 --- a/src/json.c +++ b/src/json.c @@ -282,7 +282,6 @@ static json_t *obj_print_json(struct output_ctx *octx, const struct obj *obj) json_decref(tmp); break; case NFT_OBJECT_CT_HELPER: - type = "ct helper"; tmp = json_pack("{s:s, s:o, s:s}", "type", obj->ct_helper.name, "protocol", proto_name_json(obj->ct_helper.l4proto), @@ -291,7 +290,6 @@ static json_t *obj_print_json(struct output_ctx *octx, const struct obj *obj) json_decref(tmp); break; case NFT_OBJECT_CT_TIMEOUT: - type = "ct timeout"; tmp = timeout_policy_json(obj->ct_timeout.l4proto, obj->ct_timeout.timeout); tmp = json_pack("{s:o, s:s, s:o}", -- cgit v1.2.3