The dynamic flag is not exported via JSON, this triggers spurious ENOTSUPP errors when restoring rulesets in JSON with dynamic flags set on. Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- src/json.c | 2 ++ src/parser_json.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/json.c b/src/json.c index 446575c2afc0..220ce0f79f2f 100644 --- a/src/json.c +++ b/src/json.c @@ -176,6 +176,8 @@ static json_t *set_print_json(struct output_ctx *octx, const struct set *set) json_array_append_new(tmp, json_pack("s", "interval")); if (set->flags & NFT_SET_TIMEOUT) json_array_append_new(tmp, json_pack("s", "timeout")); + if (set->flags & NFT_SET_EVAL) + json_array_append_new(tmp, json_pack("s", "dynamic")); if (json_array_size(tmp) > 0) { json_object_set_new(root, "flags", tmp); diff --git a/src/parser_json.c b/src/parser_json.c index df327e9558e0..16961d6013af 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -3136,6 +3136,7 @@ static int string_to_set_flag(const char *str) { NFT_SET_CONSTANT, "constant" }, { NFT_SET_INTERVAL, "interval" }, { NFT_SET_TIMEOUT, "timeout" }, + { NFT_SET_EVAL, "dynamic" }, }; unsigned int i; -- 2.30.2