]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: parse_server() must take a const for the defproxy
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 11:15:05 +0000 (12:15 +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/server.h
src/server.c

index b295ebd0387e351fb706aee73b3a0a4b2b20bb6f..5ca0fe90dc5adbd169d7d44a17d8091a0078f741 100644 (file)
@@ -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);
index a77579abeff290fc22cb0574fcfcba3dda250f75..e95580fe1c6888622bf0b973b5d9873ff7a0d2b8 100644 (file)
@@ -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;