From 1ba32032ef93ed14fc2eb25003b05b7087c835ac Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 21 Jan 2019 07:48:26 +0100 Subject: [PATCH] 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. --- src/server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server.c b/src/server.c index 678b723fc..6ff4c3ad9 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;