From: Olivier Houchard Date: Thu, 27 Dec 2018 14:35:22 +0000 (+0100) Subject: BUG/MAJOR: servers: Correctly use LIST_ELEM(). X-Git-Tag: v2.0-dev1~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f7de56a08701f05967af98fc9b0b40ed2017b14;p=thirdparty%2Fhaproxy.git BUG/MAJOR: servers: Correctly use LIST_ELEM(). To access the first element of the list, correctly use LIST_ELEM(), or we end up getting the head of the list, instead of getting the first connection. This should be backported to 1.9. --- diff --git a/src/backend.c b/src/backend.c index e82775058b..0c17ef893c 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1151,7 +1151,7 @@ int connect_server(struct stream *s) srv_conn = NULL; for (i = 0; i < MAX_SRV_LIST; i++) { if (!LIST_ISEMPTY(&s->sess->srv_list[i].list)) { - srv_conn = LIST_ELEM(&s->sess->srv_list[i].list, + srv_conn = LIST_ELEM(s->sess->srv_list[i].list.n, struct connection *, session_list); break; }