]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: mworker: fix infinite loop on master with no proxies.
authorEmeric Brun <ebrun@haproxy.com>
Mon, 22 Aug 2022 08:25:11 +0000 (10:25 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 22 Aug 2022 11:09:29 +0000 (13:09 +0200)
The master is re-exec with an empty proxies list if no master CLI is
configured.

This results in infinite loop since last patch:
3b68b602 ("BUG/MAJOR: log-forward: Fix log-forward proxies not fully initialized")

This patch avoid to loop again on log-forward proxies list if empty.

This patch should be backported until v2.3

src/cfgparse.c

index 989f313a9349a271a3dc7339cb29ec786abaa1fa..4201c1354183604c69eae6166e2748d15de832d0 100644 (file)
@@ -3906,7 +3906,9 @@ out_uri_auth_compat:
         */
        if (init_proxies_list == proxies_list) {
                init_proxies_list = cfg_log_forward;
-               goto init_proxies_list_stage1;
+               /* check if list is not null to avoid infinite loop */
+               if (init_proxies_list)
+                       goto init_proxies_list_stage1;
        }
 
        /***********************************************************/
@@ -4058,7 +4060,9 @@ init_proxies_list_stage2:
         */
        if (init_proxies_list == proxies_list) {
                init_proxies_list = cfg_log_forward;
-               goto init_proxies_list_stage2;
+               /* check if list is not null to avoid infinite loop */
+               if (init_proxies_list)
+                       goto init_proxies_list_stage2;
        }
 
        if (diag_no_cluster_secret)