]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: trace: Test server existence for health-checks to get proxy
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Jun 2022 07:06:15 +0000 (09:06 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Jun 2022 13:28:38 +0000 (15:28 +0200)
Email alerts are based on health-checks but with no server. Thus, in
__trace() function, responsible to write a trace message, we must be
prepared to have no server and thus no proxy.

This patch must be backported as far as 2.4.

src/trace.c

index 541acf213245fe0f961a4db5b4b648a196138bbf..5909dd438df2978048ef856c428f0ce34864d817 100644 (file)
@@ -144,7 +144,7 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
        }
        if (check) {
                srv = check->server;
-               be = srv->proxy;
+               be = (srv ? srv->proxy : NULL);
        }
 
        if (!srv && conn)