From: Willy Tarreau Date: Mon, 21 Jan 2019 06:48:26 +0000 (+0100) Subject: BUG/MEDIUM: checks: fix recent regression on agent-check making it crash X-Git-Tag: v2.0-dev1~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ba32032ef93ed14fc2eb25003b05b7087c835ac;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: checks: fix recent regression on agent-check making it crash In order to address the mailers issues, we needed to store the proxy into the checks struct, which was done by commit c98aa1f18 ("MINOR: checks: Store the proxy in checks."). However this one did it only for the health checks and not for the agent checks, resulting in an immediate crash when the agent is enabled on a random config like this one : listen agent bind :8000 server s1 255.255.255.255:1 agent-check agent-port 1 Thanks to Seri Kim for reporting it and providing a reproducer in issue #20. This fix must be backported to 1.9. --- diff --git a/src/server.c b/src/server.c index 678b723fcc..6ff4c3ad9d 100644 --- a/src/server.c +++ b/src/server.c @@ -1726,6 +1726,7 @@ struct server *new_server(struct proxy *proxy) srv->agent.status = HCHK_STATUS_INI; srv->agent.server = srv; + srv->agent.proxy = proxy; srv->xprt = srv->check.xprt = srv->agent.xprt = xprt_get(XPRT_RAW); srv->pool_purge_delay = 1000;