]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: extcheck: proxy_parse_extcheck() must take a const for the defproxy
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 11:07:38 +0000 (12:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 15:23:46 +0000 (16:23 +0100)
The default proxy was passed as a variable, which in addition to being
a PITA to deal with in the config parser, doesn't feel safe to use when
it ought to be const.

This will only affect new code so no backport is needed.

include/haproxy/extcheck.h
src/extcheck.c

index 762971951be65071d04f5be2c6752c6a5b417967..6186bee9adc721fae655840657bd5135c1281461 100644 (file)
@@ -35,7 +35,7 @@ int proxy_parse_extcheck(char **args, int section, struct proxy *curpx,
                          struct proxy *defpx, const char *file, int line,
                          char **errmsg);
 
-int proxy_parse_external_check_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
+int proxy_parse_external_check_opt(char **args, int cur_arg, struct proxy *curpx, const struct proxy *defpx,
                                    const char *file, int line);
 
 
index 6665e96bfb494eaecf6f7faba6b1b1f53d865262..9ef87c55b1f8f5c48d2810e59b81867ef265a71a 100644 (file)
@@ -648,7 +648,7 @@ error:
        return -1;
 }
 
-int proxy_parse_external_check_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
+int proxy_parse_external_check_opt(char **args, int cur_arg, struct proxy *curpx, const struct proxy *defpx,
                                   const char *file, int line)
 {
        int err_code = 0;