Hi,

The attached patch renames the global variable "proxy" to "proxies_list".
"proxy" is commonly used as a name for function arguments, and a number of
times, "proxy" was used when another variable was really meant. It worked
by luck, but can certainly come back to bite us at some point.

Regards,

Olivier
>From da26886c44f7bd9dff656c43498664fb3518775d Mon Sep 17 00:00:00 2001
From: Olivier Houchard <ohouch...@haproxy.com>
Date: Fri, 24 Nov 2017 16:54:05 +0100
Subject: [PATCH] MINOR/CLEANUP: proxy: rename "proxy" to "proxies_list"

Rename the global variable "proxy" to "proxies_list".
There's been multiple proxies in haproxy for quite some time, and "proxy"
is a potential source of bugs, a number of functions have a "proxy" argument,
and some code used "proxy" when it really meant "px" or "curproxy". It worked
by pure luck, because it usually happened while parsing the config, and thus
"proxy" pointed to the currently parsed proxy, but we should probably not
rely on this.
---
 include/proto/proxy.h |  2 +-
 src/cache.c           |  2 +-
 src/cfgparse.c        | 34 +++++++++++++++++-----------------
 src/checks.c          |  4 ++--
 src/cli.c             |  8 ++++----
 src/dns.c             |  2 +-
 src/filters.c         |  6 +++---
 src/flt_spoe.c        |  2 +-
 src/haproxy.c         | 14 +++++++-------
 src/hlua_fcn.c        |  6 +++---
 src/proto_http.c      | 16 ++++++++--------
 src/proto_tcp.c       |  4 ++--
 src/proxy.c           | 17 ++++++++---------
 src/server.c          |  5 ++---
 src/stats.c           |  4 ++--
 src/stick_table.c     |  2 +-
 16 files changed, 63 insertions(+), 65 deletions(-)

diff --git a/include/proto/proxy.h b/include/proto/proxy.h
index cb86159a9..d4a34a54f 100644
--- a/include/proto/proxy.h
+++ b/include/proto/proxy.h
@@ -31,7 +31,7 @@
 #include <types/listener.h>
 #include <proto/freq_ctr.h>
 
-extern struct proxy *proxy;
+extern struct proxy *proxies_list;
 extern struct eb_root used_proxy_id;   /* list of proxy IDs in use */
 extern unsigned int error_snapshot_id;  /* global ID assigned to each error 
then incremented */
 extern struct eb_root proxy_by_name;    /* tree of proxies sorted by name */
diff --git a/src/cache.c b/src/cache.c
index 7ae3267e5..f36ada238 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -840,7 +840,7 @@ int cfg_cache_postparser()
        int err = 0;
        struct flt_conf *fconf;
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
 
                /* resolve the http response cache name to a ptr in the action 
rule */
                list_for_each_entry(hresrule, &curproxy->http_res_rules, list) {
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 1a75686cb..9bebd644d 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2747,8 +2747,8 @@ int cfg_parse_listen(const char *file, int linenum, char 
**args, int kwm)
                }
 
                init_new_proxy(curproxy);
-               curproxy->next = proxy;
-               proxy = curproxy;
+               curproxy->next = proxies_list;
+               proxies_list = curproxy;
                curproxy->conf.args.file = curproxy->conf.file = strdup(file);
                curproxy->conf.args.line = curproxy->conf.line = linenum;
                curproxy->last_change = now.tv_sec;
@@ -7546,18 +7546,18 @@ int check_config_validity()
 
        /* first, we will invert the proxy list order */
        curproxy = NULL;
-       while (proxy) {
+       while (proxies_list) {
                struct proxy *next;
 
-               next = proxy->next;
-               proxy->next = curproxy;
-               curproxy = proxy;
+               next = proxies_list->next;
+               proxies_list->next = curproxy;
+               curproxy = proxies_list;
                if (!next)
                        break;
-               proxy = next;
+               proxies_list = next;
        }
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                struct switching_rule *rule;
                struct server_rule *srule;
                struct sticking_rule *mrule;
@@ -8819,7 +8819,7 @@ out_uri_auth_compat:
        }
 
        /* Make each frontend inherit bind-process from its listeners when not 
specified. */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->bind_proc)
                        continue;
 
@@ -8849,14 +8849,14 @@ out_uri_auth_compat:
         * are any fatal errors as we must not call it with unresolved proxies.
         */
        if (!cfgerr) {
-               for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+               for (curproxy = proxies_list; curproxy; curproxy = 
curproxy->next) {
                        if (curproxy->cap & PR_CAP_FE)
                                propagate_processes(curproxy, NULL);
                }
        }
 
        /* Bind each unbound backend to all processes when not specified. */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->bind_proc)
                        continue;
                curproxy->bind_proc = nbits(global.nbproc);
@@ -8868,7 +8868,7 @@ out_uri_auth_compat:
 
        /* perform the final checks before creating tasks */
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                struct listener *listener;
                unsigned int next_id;
 
@@ -9000,7 +9000,7 @@ out_uri_auth_compat:
        /* automatically compute fullconn if not set. We must not do it in the
         * loop above because cross-references are not yet fully resolved.
         */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                /* If <fullconn> is not set, let's set it to 10% of the sum of
                 * the possible incoming frontend's maxconns.
                 */
@@ -9019,7 +9019,7 @@ out_uri_auth_compat:
         * Recount currently required checks.
         */
 
-       for (curproxy=proxy; curproxy; curproxy=curproxy->next) {
+       for (curproxy=proxies_list; curproxy; curproxy=curproxy->next) {
                int optnum;
 
                for (optnum = 0; cfg_opts[optnum].name; optnum++)
@@ -9032,7 +9032,7 @@ out_uri_auth_compat:
        }
 
        /* compute the required process bindings for the peers */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next)
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next)
                if (curproxy->table.peers.p)
                        curproxy->table.peers.p->peers_fe->bind_proc |= 
curproxy->bind_proc;
 
@@ -9099,7 +9099,7 @@ out_uri_auth_compat:
         * be done earlier because the data size may be discovered while parsing
         * other proxies.
         */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->state == PR_STSTOPPED)
                        continue;
 
@@ -9147,7 +9147,7 @@ out_uri_auth_compat:
 
        /* Update server_state_file_name to backend name if backend is supposed 
to use
         * a server-state file locally defined and none has been provided */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->load_server_state_from_file == 
PR_SRV_STATE_FILE_LOCAL &&
                    curproxy->server_state_file_name == NULL)
                        curproxy->server_state_file_name = strdup(curproxy->id);
diff --git a/src/checks.c b/src/checks.c
index 4b47cf390..7a090e78f 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -2332,7 +2332,7 @@ static int start_checks()
         * a shorter interval will start independently and will not dictate
         * too short an interval for all others.
         */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                for (s = px->srv; s; s = s->next) {
                        if (s->slowstart) {
                                if ((t = task_new(MAX_THREADS_MASK)) == NULL) {
@@ -2376,7 +2376,7 @@ static int start_checks()
         * start them after their interval set to the min interval divided by
         * the number of servers, weighted by the server's position in the list.
         */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if ((px->options2 & PR_O2_CHK_ANY) == PR_O2_EXT_CHK) {
                        if (init_pid_list()) {
                                Alert("Starting [%s] check: out of memory.\n", 
px->id);
diff --git a/src/cli.c b/src/cli.c
index 038bdd383..493a13981 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -170,8 +170,8 @@ static struct proxy *alloc_stats_fe(const char *name, const 
char *file, int line
                return NULL;
 
        init_new_proxy(fe);
-       fe->next = proxy;
-       proxy = fe;
+       fe->next = proxies_list;
+       proxies_list = fe;
        fe->last_change = now.tv_sec;
        fe->id = strdup("GLOBAL");
        fe->cap = PR_CAP_FE;
@@ -1276,7 +1276,7 @@ static int _getsocks(char **args, struct appctx *appctx, 
void *private)
         * First, calculates the total number of FD, so that we can let
         * the caller know how much he should expects.
         */
-       px = proxy;
+       px = proxies_list;
        while (px) {
                struct listener *l;
 
@@ -1313,7 +1313,7 @@ static int _getsocks(char **args, struct appctx *appctx, 
void *private)
        cmsg->cmsg_type = SCM_RIGHTS;
        tmpfd = (int *)CMSG_DATA(cmsg);
 
-       px = proxy;
+       px = proxies_list;
        /* For each socket, e message is sent, containing the following :
         *  Size of the namespace name (or 0 if none), as an unsigned char.
         *  The namespace name, if any
diff --git a/src/dns.c b/src/dns.c
index 8f01f053b..1f0bae86c 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -1897,7 +1897,7 @@ static int dns_finalize_config(void)
                task_wakeup(t, TASK_WOKEN_INIT);
        }
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                struct server *srv;
 
                for (srv = px->srv; srv; srv = srv->next) {
diff --git a/src/filters.c b/src/filters.c
index c1d3f877f..ac6f10c00 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -288,7 +288,7 @@ flt_init_all()
        struct proxy *px;
        int err_code = 0;
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                err_code |= flt_init(px);
                if (err_code & (ERR_ABORT|ERR_FATAL)) {
                        Alert("Failed to initialize filters for proxy '%s'.\n",
@@ -307,7 +307,7 @@ flt_init_all_per_thread()
        struct proxy *px;
        int err_code = 0;
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                err_code = flt_init_per_thread(px);
                if (err_code & (ERR_ABORT|ERR_FATAL)) {
                        Alert("Failed to initialize filters for proxy '%s' for 
thread %u.\n",
@@ -376,7 +376,7 @@ flt_deinit_all_per_thread()
 {
        struct proxy *px;
 
-       for (px = proxy; px; px = px->next)
+       for (px = proxies_list; px; px = px->next)
                flt_deinit_per_thread(px);
 }
 
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index ea4675cb7..728bc2215 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -2796,7 +2796,7 @@ spoe_sig_stop(struct sig_handler *sh)
 {
        struct proxy *p;
 
-       p = proxy;
+       p = proxies_list;
        while (p) {
                struct flt_conf *fconf;
 
diff --git a/src/haproxy.c b/src/haproxy.c
index 381d5a9fc..82b03ea8d 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -555,7 +555,7 @@ static void mworker_cleanlisteners()
        struct listener *l, *l_next;
        struct proxy *curproxy;
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
 
                list_for_each_entry_safe(l, l_next, &curproxy->conf.listeners, 
by_fe) {
                        /* does not close if the FD is inherited with fd@
@@ -821,7 +821,7 @@ static void sig_listen(struct sig_handler *sh)
  */
 static void sig_dump_state(struct sig_handler *sh)
 {
-       struct proxy *p = proxy;
+       struct proxy *p = proxies_list;
 
        Warning("SIGHUP received, dumping servers states.\n");
        while (p) {
@@ -1540,7 +1540,7 @@ static void init(int argc, char **argv)
        /* Apply server states */
        apply_server_state();
 
-       for (px = proxy; px; px = px->next)
+       for (px = proxies_list; px; px = px->next)
                srv_compute_all_admin_states(px);
 
        /* Apply servers' configured address */
@@ -1558,7 +1558,7 @@ static void init(int argc, char **argv)
                        if (pr->peers_fe)
                                break;
 
-               for (px = proxy; px; px = px->next)
+               for (px = proxies_list; px; px = px->next)
                        if (px->state == PR_STNEW && 
!LIST_ISEMPTY(&px->conf.listeners))
                                break;
 
@@ -1745,7 +1745,7 @@ static void init(int argc, char **argv)
                struct proxy *cur;
                int nbfe = 0, nbbe = 0;
 
-               for (cur = proxy; cur; cur = cur->next) {
+               for (cur = proxies_list; cur; cur = cur->next) {
                        if (cur->options2 & (PR_O2_SPLIC_ANY)) {
                                if (cur->cap & PR_CAP_FE)
                                        nbfe += cur->maxconn;
@@ -1926,7 +1926,7 @@ static void deinit_stick_rules(struct list *rules)
 
 void deinit(void)
 {
-       struct proxy *p = proxy, *p0;
+       struct proxy *p = proxies_list, *p0;
        struct cap_hdr *h,*h_next;
        struct server *s,*s_next;
        struct listener *l,*l_next;
@@ -2823,7 +2823,7 @@ int main(int argc, char **argv)
                }
 
                /* we might have to unbind some proxies from some processes */
-               px = proxy;
+               px = proxies_list;
                while (px != NULL) {
                        if (px->bind_proc && px->state != PR_STSTOPPED) {
                                if (!(px->bind_proc & (1UL << proc))) {
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index 54fbfa79a..a8d53d45b 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -943,7 +943,7 @@ int hlua_fcn_post_init(lua_State *L)
        lua_newtable(L);
 
        /* List all proxies. */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                lua_pushstring(L, px->id);
                hlua_fcn_new_proxy(L, px);
                lua_settable(L, -3);
@@ -957,7 +957,7 @@ int hlua_fcn_post_init(lua_State *L)
        lua_newtable(L);
 
        /* List all proxies. */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (!(px->cap & PR_CAP_FE))
                        continue;
                lua_pushstring(L, px->id);
@@ -973,7 +973,7 @@ int hlua_fcn_post_init(lua_State *L)
        lua_newtable(L);
 
        /* List all proxies. */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (!(px->cap & PR_CAP_BE))
                        continue;
                lua_pushstring(L, px->id);
diff --git a/src/proto_http.c b/src/proto_http.c
index 277efb817..de4411d00 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -9184,7 +9184,7 @@ struct redirect_rule *http_parse_redirect_rule(const char 
*file, int linenum, st
                }
                else if (strcmp(args[cur_arg], "if") == 0 ||
                         strcmp(args[cur_arg], "unless") == 0) {
-                       cond = build_acl_cond(file, linenum, &proxy->acl, 
curproxy, (const char **)args + cur_arg, errmsg);
+                       cond = build_acl_cond(file, linenum, &curproxy->acl, 
curproxy, (const char **)args + cur_arg, errmsg);
                        if (!cond) {
                                memprintf(errmsg, "error in condition: %s", 
*errmsg);
                                return NULL;
@@ -11873,9 +11873,9 @@ enum act_parse_ret parse_set_req_line(const char 
**args, int *orig_arg, struct p
        }
 
        LIST_INIT(&rule->arg.http.logfmt);
-       proxy->conf.args.ctx = ARGC_HRQ;
-       if (!parse_logformat_string(args[cur_arg], proxy, 
&rule->arg.http.logfmt, LOG_OPT_HTTP,
-                                   (proxy->cap & PR_CAP_FE) ? 
SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, err)) {
+       px->conf.args.ctx = ARGC_HRQ;
+       if (!parse_logformat_string(args[cur_arg], px, &rule->arg.http.logfmt, 
LOG_OPT_HTTP,
+                                   (px->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR 
: SMP_VAL_BE_HRQ_HDR, err)) {
                return ACT_RET_PRS_ERR;
        }
 
@@ -12102,7 +12102,7 @@ enum act_parse_ret parse_http_req_capture(const char 
**args, int *orig_arg, stru
                        return ACT_RET_PRS_ERR;
                }
 
-               proxy->conf.args.ctx = ARGC_CAP;
+               px->conf.args.ctx = ARGC_CAP;
 
                if (!args[cur_arg]) {
                        memprintf(err, "missing length value");
@@ -12162,7 +12162,7 @@ enum act_parse_ret parse_http_req_capture(const char 
**args, int *orig_arg, stru
                }
                cur_arg++;
 
-               proxy->conf.args.ctx = ARGC_CAP;
+               px->conf.args.ctx = ARGC_CAP;
 
                rule->action       = ACT_CUSTOM;
                rule->action_ptr   = http_action_req_capture_by_id;
@@ -12302,7 +12302,7 @@ enum act_parse_ret parse_http_res_capture(const char 
**args, int *orig_arg, stru
        }
        cur_arg++;
 
-       proxy->conf.args.ctx = ARGC_CAP;
+       px->conf.args.ctx = ARGC_CAP;
 
        rule->action       = ACT_CUSTOM;
        rule->action_ptr   = http_action_res_capture_by_id;
@@ -12399,7 +12399,7 @@ static int cli_io_handler_show_errors(struct appctx 
*appctx)
                        return 0;
                }
 
-               appctx->ctx.errors.px = proxy;
+               appctx->ctx.errors.px = proxies_list;
                appctx->ctx.errors.bol = 0;
                appctx->ctx.errors.ptr = -1;
        }
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 606c3c5e0..0a5bc7293 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1398,9 +1398,9 @@ enum act_parse_ret tcp_parse_set_src_dst(const char 
**args, int *orig_arg, struc
                return ACT_RET_PRS_ERR;
 
        where = 0;
-       if (proxy->cap & PR_CAP_FE)
+       if (px->cap & PR_CAP_FE)
                where |= SMP_VAL_FE_HRQ_HDR;
-       if (proxy->cap & PR_CAP_BE)
+       if (px->cap & PR_CAP_BE)
                where |= SMP_VAL_BE_HRQ_HDR;
 
        if (!(expr->fetch->val & where)) {
diff --git a/src/proxy.c b/src/proxy.c
index ccbc7b22e..c62dc4acd 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -54,7 +54,7 @@
 
 
 int listeners; /* # of proxy listeners, set by cfgparse */
-struct proxy *proxy  = NULL;   /* list of all existing proxies */
+struct proxy *proxies_list  = NULL;    /* list of all existing proxies */
 struct eb_root used_proxy_id = EB_ROOT;        /* list of proxy IDs in use */
 struct eb_root proxy_by_name = EB_ROOT; /* tree of proxies sorted by name */
 unsigned int error_snapshot_id = 0;     /* global ID assigned to each error 
then incremented */
@@ -783,7 +783,7 @@ int start_proxies(int verbose)
        int pxerr;
        char msg[100];
 
-       for (curproxy = proxy; curproxy != NULL; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy != NULL; curproxy = 
curproxy->next) {
                if (curproxy->state != PR_STNEW)
                        continue; /* already initialized */
 
@@ -949,7 +949,7 @@ struct task *hard_stop(struct task *t)
 
        Warning("soft-stop running for too long, performing a hard-stop.\n");
        send_log(NULL, LOG_WARNING, "soft-stop running for too long, performing 
a hard-stop.\n");
-       p = proxy;
+       p = proxies_list;
        while (p) {
                if ((p->cap & PR_CAP_FE) && (p->feconn > 0)) {
                        Warning("Proxy %s hard-stopped (%d remaining conns will 
be closed).\n",
@@ -990,7 +990,7 @@ void soft_stop(void)
                        Alert("out of memory trying to allocate the hard-stop 
task.\n");
                }
        }
-       p = proxy;
+       p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
                /* Zombie proxy, let's close the file descriptors */
@@ -1186,7 +1186,7 @@ void pause_proxies(void)
        struct peers *prs;
 
        err = 0;
-       p = proxy;
+       p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
                err |= !pause_proxy(p);
@@ -1220,7 +1220,7 @@ void resume_proxies(void)
        struct peers *prs;
 
        err = 0;
-       p = proxy;
+       p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
                err |= !resume_proxy(p);
@@ -1482,14 +1482,13 @@ static int dump_servers_state(struct stream_interface 
*si, struct chunk *buf)
 static int cli_io_handler_servers_state(struct appctx *appctx)
 {
        struct stream_interface *si = appctx->owner;
-       extern struct proxy *proxy;
        struct proxy *curproxy;
 
        chunk_reset(&trash);
 
        if (appctx->st2 == STAT_ST_INIT) {
                if (!appctx->ctx.cli.p0)
-                       appctx->ctx.cli.p0 = proxy;
+                       appctx->ctx.cli.p0 = proxies_list;
                appctx->st2 = STAT_ST_HEAD;
        }
 
@@ -1535,7 +1534,7 @@ static int cli_io_handler_show_backend(struct appctx 
*appctx)
                        si_applet_cant_put(si);
                        return 0;
                }
-               appctx->ctx.cli.p0 = proxy;
+               appctx->ctx.cli.p0 = proxies_list;
        }
 
        for (; appctx->ctx.cli.p0 != NULL; appctx->ctx.cli.p0 = curproxy->next) 
{
diff --git a/src/server.c b/src/server.c
index c712b889c..2cb19da31 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2953,7 +2953,6 @@ void apply_server_state(void)
        char globalfilepath[MAXPATHLEN + 1];
        char localfilepath[MAXPATHLEN + 1];
        int len, fileopenerr, globalfilepathlen, localfilepathlen;
-       extern struct proxy *proxy;
        struct proxy *curproxy, *bk;
        struct server *srv;
 
@@ -3006,7 +3005,7 @@ void apply_server_state(void)
                globalfilepath[0] = '\0';
 
        /* read servers state from local file */
-       for (curproxy = proxy; curproxy != NULL; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy != NULL; curproxy = 
curproxy->next) {
                /* servers are only in backends */
                if (!(curproxy->cap & PR_CAP_BE))
                        continue;
@@ -3932,7 +3931,7 @@ int srv_init_addr(void)
        struct proxy *curproxy;
        int return_code = 0;
 
-       curproxy = proxy;
+       curproxy = proxies_list;
        while (curproxy) {
                struct server *srv;
 
diff --git a/src/stats.c b/src/stats.c
index 6cef1bfc7..01259282d 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -2550,7 +2550,7 @@ static int stats_dump_stat_to_buffer(struct 
stream_interface *si, struct uri_aut
                        }
                }
 
-               appctx->ctx.stats.px = proxy;
+               appctx->ctx.stats.px = proxies_list;
                appctx->ctx.stats.px_st = STAT_PX_ST_INIT;
                appctx->st2 = STAT_ST_LIST;
                /* fall through */
@@ -3537,7 +3537,7 @@ static int cli_parse_clear_counters(char **args, struct 
appctx *appctx, void *pr
            (clrall && !cli_has_level(appctx, ACCESS_LVL_ADMIN)))
                return 1;
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (clrall) {
                        memset(&px->be_counters, 0, sizeof(px->be_counters));
                        memset(&px->fe_counters, 0, sizeof(px->fe_counters));
diff --git a/src/stick_table.c b/src/stick_table.c
index 635114325..bd0c8280f 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -3134,7 +3134,7 @@ static int cli_io_handler_table(struct appctx *appctx)
                case STAT_ST_INIT:
                        appctx->ctx.table.proxy = appctx->ctx.table.target;
                        if (!appctx->ctx.table.proxy)
-                               appctx->ctx.table.proxy = proxy;
+                               appctx->ctx.table.proxy = proxies_list;
 
                        appctx->ctx.table.entry = NULL;
                        appctx->st2 = STAT_ST_INFO;
-- 
2.14.3

Reply via email to