]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log/backend: prevent "use-server" rules use with LOG mode
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 23 Nov 2023 15:40:19 +0000 (16:40 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Nov 2023 15:27:55 +0000 (16:27 +0100)
server_rules declared using "use-server" keyword within a proxy are not
supported inside a log backend (with "mode log" set), so we report a
warning to the user and reset the setting.

src/log.c

index 1a132590bd89eea6dd80624a91cf8923c700f085..c6222c5999c301f21cb7b6a74bd509096fbd31b0 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -929,6 +929,13 @@ static int _postcheck_log_backend_compat(struct proxy *be)
                err_code |= ERR_WARN;
                ha_free(&be->dyncookie_key);
        }
+       if (!LIST_ISEMPTY(&be->server_rules)) {
+               ha_warning("Cannot use \"use-server\" rules with 'mode log' in %s '%s'. They will be ignored.\n",
+                          proxy_type_str(be), be->id);
+
+               err_code |= ERR_WARN;
+               free_server_rules(&be->server_rules);
+       }
        return err_code;
 }