]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: only run postcheck_log_backend() checks on backend
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 9 May 2025 14:34:27 +0000 (16:34 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 2 Jun 2025 15:51:24 +0000 (17:51 +0200)
postcheck_log_backend() checks are executed no matter if the proxy
actually has the backend capability while the checks actually depend
on this.

Let's fix that by adding an extra condition to ensure that the BE
capability is set.

This issue is not tagged as a bug because for now it remains impossible
to have a syslog proxy without BE capability in the main proxy list, but
this may change in the future.

src/log.c

index 9ca61985605fddc7a0b53b09238fb30894cd6afc..12c8a3a4c9f65be7a93dd98bede7c1083387f3f8 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1348,7 +1348,7 @@ static int postcheck_log_backend(struct proxy *be)
        int err_code = ERR_NONE;
        int target_type = -1; // -1 is unused in log_tgt enum
 
-       if (be->mode != PR_MODE_SYSLOG ||
+       if (!(be->cap & PR_CAP_BE) || be->mode != PR_MODE_SYSLOG ||
            (be->flags & (PR_FL_DISABLED|PR_FL_STOPPED)))
                return ERR_NONE; /* nothing to do */