]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: ssl: ckch_conf_parse() uses -1/0/1 for off/default/on
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 30 Apr 2024 19:38:16 +0000 (21:38 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 17 May 2024 15:35:51 +0000 (17:35 +0200)
ckch_conf_parse() now set -1 for a off value and 1 for a on value.
This allow to detect when a value is the default since the struct are memset
to 0.

src/ssl_ckch.c

index f8b3333132063cbf049826e62c5b4e6390ec5e6a..549637d6a96cf17977795a17f81ee13e05474754 100644 (file)
@@ -4166,7 +4166,7 @@ int ckch_conf_parse(char **args, int cur_arg, struct ckch_conf *f, int *found, c
                                if (strcmp(args[cur_arg + 1], "on") == 0) {
                                        *t = 1;
                                } else if (strcmp(args[cur_arg + 1], "off") == 0) {
-                                       *t = 0;
+                                       *t = -1;
                                } else {
                                        memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', 'on' or 'off' is expected.\n",
                                                  file, linenum, args[cur_arg], args[cur_arg + 1]);