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