]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: srv-state: allow to have both CMAINT and FDRAIN flags
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Nov 2016 17:33:25 +0000 (18:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Nov 2016 13:30:19 +0000 (14:30 +0100)
CMAINT indicates that the server was *initially* disabled in the
configuration via the "disabled" keyword. FDRAIN indicates that the
server was switched to the DRAIN state from the CLI or the agent.
This it's perfectly valid to have both of them in the state file,
so the parser must not reject this combination.

This fix must be backported to 1.6.

src/server.c

index 8150c692d1b14a9371782700b0606ef788dacbef..3be2bc82912dc5145f4942531d807b7772d0869c 100644 (file)
@@ -2029,6 +2029,7 @@ static void srv_update_state(struct server *srv, int version, char **params)
                             srv_admin_state != SRV_ADMF_IMAINT &&
                             srv_admin_state != SRV_ADMF_CMAINT &&
                             srv_admin_state != (SRV_ADMF_CMAINT | SRV_ADMF_FMAINT) &&
+                            srv_admin_state != (SRV_ADMF_CMAINT | SRV_ADMF_FDRAIN) &&
                             srv_admin_state != SRV_ADMF_FDRAIN &&
                             srv_admin_state != SRV_ADMF_IDRAIN)) {
                                chunk_appendf(msg, ", invalid srv_admin_state value '%s'", params[2]);