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.
This commit is contained in:
Olivier Houchard 2018-12-27 15:35:22 +01:00 committed by Willy Tarreau
parent c3fa638b4c
commit 5f7de56a08

View File

@ -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;
}