From: Willy Tarreau Date: Fri, 12 Feb 2021 11:15:05 +0000 (+0100) Subject: BUG/MINOR: server: parse_server() must take a const for the defproxy X-Git-Tag: v2.4-dev8~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb8669ae283291ce9edc60c01936afb2337182c3;p=thirdparty%2Fhaproxy.git BUG/MINOR: server: parse_server() must take a const for the defproxy 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. --- diff --git a/include/haproxy/server.h b/include/haproxy/server.h index b295ebd038..5ca0fe90dc 100644 --- a/include/haproxy/server.h +++ b/include/haproxy/server.h @@ -44,7 +44,7 @@ extern struct dict server_key_dict; int srv_downtime(const struct server *s); int srv_lastsession(const struct server *s); int srv_getinter(const struct check *check); -int parse_server(const char *file, int linenum, char **args, struct proxy *curproxy, struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve); +int parse_server(const char *file, int linenum, char **args, struct proxy *curproxy, const struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve); int update_server_addr(struct server *s, void *ip, int ip_sin_family, const char *updater); const char *update_server_addr_port(struct server *s, const char *addr, const char *port, char *updater); struct server *server_find_by_id(struct proxy *bk, int id); diff --git a/src/server.c b/src/server.c index a77579abef..e95580fe1c 100644 --- a/src/server.c +++ b/src/server.c @@ -1940,7 +1940,7 @@ static int server_template_init(struct server *srv, struct proxy *px) } int parse_server(const char *file, int linenum, char **args, struct proxy *curproxy, - struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve) + const struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve) { struct server *newsrv = NULL; const char *err = NULL;