From 647a61cc4b167bc394a38f7f3fa7d2a176b90729 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 30 Sep 2021 18:11:54 +0200 Subject: [PATCH] BUG/MINOR: proxy: Use .disabled field as a bitfield as documented .disabled field in the proxy structure is documented to be a bitfield. So use it as a bitfield. This change was introduced to the 2.5, by commit 8e765b86f ("MINOR: proxy: disabled takes a stopping and a disabled state"). No backport is needed except if the above commit is backported. --- src/cfgparse-listen.c | 2 +- src/cfgparse.c | 2 +- src/mworker.c | 2 +- src/proxy.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 98e31ec..6f526d4 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -595,7 +595,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) else if (strcmp(args[0], "disabled") == 0) { /* disables this proxy */ if (alertif_too_many_args(0, file, linenum, args, &err_code)) goto out; - curproxy->disabled = PR_DISABLED; + curproxy->disabled |= PR_DISABLED; } else if (strcmp(args[0], "enabled") == 0) { /* enables this proxy (used to revert a disabled default) */ if (alertif_too_many_args(0, file, linenum, args, &err_code)) diff --git a/src/cfgparse.c b/src/cfgparse.c index 173dcdb..e606a47 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1019,7 +1019,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) stktables_list = t; } else if (strcmp(args[0], "disabled") == 0) { /* disables this peers section */ - curpeers->disabled = PR_DISABLED; + curpeers->disabled |= PR_DISABLED; } else if (strcmp(args[0], "enabled") == 0) { /* enables this peers section (used to revert a disabled default) */ curpeers->disabled = 0; diff --git a/src/mworker.c b/src/mworker.c index ca1cc74..7c73780 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -443,7 +443,7 @@ void mworker_cleanlisteners() } /* if the proxy shouldn't be in the master, we stop it */ if (!listen_in_master) - curproxy->disabled = PR_DISABLED; + curproxy->disabled |= PR_DISABLED; } } diff --git a/src/proxy.c b/src/proxy.c index 6868eff..4dbf671 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1823,7 +1823,7 @@ void proxy_cond_disable(struct proxy *p) if (p->li_ready + p->li_paused > 0) return; - p->disabled = PR_STOPPED; + p->disabled |= PR_STOPPED; /* Note: syslog proxies use their own loggers so while it's somewhat OK * to report them being stopped as a warning, we must not spam their log -- 1.7.10.4