summaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c
index 276a3c0f..4900c023 100644
--- a/src/json.c
+++ b/src/json.c
@@ -864,7 +864,12 @@ json_t *socket_expr_json(const struct expr *expr, struct output_ctx *octx)
json_t *osf_expr_json(const struct expr *expr, struct output_ctx *octx)
{
- json_t *root = json_pack("{s:s}", "key", "name");
+ json_t *root;
+
+ if (expr->osf.flags & NFT_OSF_F_VERSION)
+ root = json_pack("{s:s}", "key", "version");
+ else
+ root = json_pack("{s:s}", "key", "name");
switch (expr->osf.ttl) {
case 1: