From 5f7de56a08701f05967af98fc9b0b40ed2017b14 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 27 Dec 2018 15:35:22 +0100 Subject: [PATCH] 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. --- src/backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index e82775058..0c17ef893 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; }