From: Jozsef Kadlecsik Date: Sat, 3 Feb 2024 20:49:48 +0000 (+0100) Subject: The "Fix hex literals in json output" broke save mode, restore it X-Git-Tag: v7.21~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2024f63f774be32abcf8992f4dc28754990558a1;p=thirdparty%2Fipset.git The "Fix hex literals in json output" broke save mode, restore it Signed-off-by: Jozsef Kadlecsik --- diff --git a/lib/session.c b/lib/session.c index a856614d..f8222883 100644 --- a/lib/session.c +++ b/lib/session.c @@ -2284,7 +2284,8 @@ ipset_cmd(struct ipset_session *session, enum ipset_cmd cmd, uint32_t lineno) if (cmd == IPSET_CMD_LIST || cmd == IPSET_CMD_SAVE) { /* Set default output mode */ if (session->mode == IPSET_LIST_NONE) - session->mode = IPSET_LIST_PLAIN; + session->mode = cmd == IPSET_CMD_LIST ? + IPSET_LIST_PLAIN : IPSET_LIST_SAVE; /* Reset just in case there are multiple modes in a session */ ipset_envopt_unset(session, IPSET_ENV_QUOTED); switch (session->mode) {