mark->cl = &svc->destinations;
mark->mw = ip_vs_wrr_max_weight(svc);
mark->di = ip_vs_wrr_gcd_weight(svc);
+ if (mark->cw > mark->mw)
+ mark->cw = 0;
return 0;
}
if (mark->cw <= 0) {
mark->cw = mark->mw;
/*
- * Still zero, which means no availabe servers.
+ * Still zero, which means no available servers.
*/
if (mark->cw == 0) {
mark->cl = &svc->destinations;
}
}
- if (mark->cl == p) {
+ if (mark->cl == p && mark->cw == mark->di) {
/* back to the start, and no dest is found.
It is only possible when all dests are OVERLOADED */
dest = NULL;