diff options
author | Phil Sutter <phil@nwl.cc> | 2025-05-08 16:44:39 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2025-05-13 10:48:53 +0200 |
commit | 38f99ee84fe6bd029fbc3d1389f42ab82fa9789c (patch) | |
tree | c8ca79e5fbe35c07c603f45cd11b077284e7af54 /src | |
parent | dbe5c44f2b891c1d305cc94a7ea9dd963a7b6100 (diff) |
json: Print single synproxy flags as non-array
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src')
-rw-r--r-- | src/json.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1686,10 +1686,14 @@ json_t *synproxy_stmt_json(const struct stmt *stmt, struct output_ctx *octx) if (stmt->synproxy.flags & NF_SYNPROXY_OPT_SACK_PERM) json_array_append_new(flags, json_string("sack-perm")); - if (json_array_size(flags) > 0) + if (json_array_size(flags) > 1) { json_object_set_new(root, "flags", flags); - else + } else { + if (json_array_size(flags)) + json_object_set(root, "flags", + json_array_get(flags, 0)); json_decref(flags); + } if (!json_object_size(root)) { json_decref(root); |