diff --git a/src/backend.c b/src/backend.c index 00537f094..13543c90e 100644 --- a/src/backend.c +++ b/src/backend.c @@ -185,7 +185,7 @@ static struct server *get_server_sh(struct proxy *px, const char *addr, int len, if ((px->lbprm.algo & BE_LB_HASH_MOD) == BE_LB_HMOD_AVAL) h = full_hash(h); hash_done: - if (px->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((px->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) return chash_get_server_hash(px, h, avoid); else return map_get_server_hash(px, h); @@ -238,7 +238,7 @@ static struct server *get_server_uh(struct proxy *px, char *uri, int uri_len, co if ((px->lbprm.algo & BE_LB_HASH_MOD) == BE_LB_HMOD_AVAL) hash = full_hash(hash); hash_done: - if (px->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((px->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) return chash_get_server_hash(px, hash, avoid); else return map_get_server_hash(px, hash); @@ -295,7 +295,7 @@ static struct server *get_server_ph(struct proxy *px, const char *uri, int uri_l if ((px->lbprm.algo & BE_LB_HASH_MOD) == BE_LB_HMOD_AVAL) hash = full_hash(hash); - if (px->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((px->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) return chash_get_server_hash(px, hash, avoid); else return map_get_server_hash(px, hash); @@ -369,7 +369,7 @@ static struct server *get_server_ph_post(struct stream *s, const struct server * if ((px->lbprm.algo & BE_LB_HASH_MOD) == BE_LB_HMOD_AVAL) hash = full_hash(hash); - if (px->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((px->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) return chash_get_server_hash(px, hash, avoid); else return map_get_server_hash(px, hash); @@ -465,7 +465,7 @@ static struct server *get_server_hh(struct stream *s, const struct server *avoid if ((px->lbprm.algo & BE_LB_HASH_MOD) == BE_LB_HMOD_AVAL) hash = full_hash(hash); hash_done: - if (px->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((px->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) return chash_get_server_hash(px, hash, avoid); else return map_get_server_hash(px, hash); @@ -510,7 +510,7 @@ static struct server *get_server_rch(struct stream *s, const struct server *avoi if ((px->lbprm.algo & BE_LB_HASH_MOD) == BE_LB_HMOD_AVAL) hash = full_hash(hash); hash_done: - if (px->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((px->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) return chash_get_server_hash(px, hash, avoid); else return map_get_server_hash(px, hash); @@ -640,7 +640,7 @@ int assign_server(struct stream *s) if ((s->be->lbprm.algo & BE_LB_KIND) == BE_LB_KIND_RR) { if ((s->be->lbprm.algo & BE_LB_PARM) == BE_LB_RR_RANDOM) srv = get_server_rnd(s, prev_srv); - else if (s->be->lbprm.algo & BE_LB_LKUP_CHTREE) + else if ((s->be->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) srv = chash_get_next_server(s->be, prev_srv); else srv = map_get_server_rr(s->be, prev_srv); @@ -716,7 +716,7 @@ int assign_server(struct stream *s) * back to round robin on the map. */ if (!srv) { - if (s->be->lbprm.algo & BE_LB_LKUP_CHTREE) + if ((s->be->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE) srv = chash_get_next_server(s->be, prev_srv); else srv = map_get_server_rr(s->be, prev_srv);