[sr-dev] git:4.4:94ef3dca: dispatcher: proper selection of the gateway when the maxload is 0

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 28 09:31:27 CEST 2016


Module: kamailio
Branch: 4.4
Commit: 94ef3dcaa99680cb12897db27d81d39e0e1e2d5e
URL: https://github.com/kamailio/kamailio/commit/94ef3dcaa99680cb12897db27d81d39e0e1e2d5e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-09-28T09:31:04+02:00

dispatcher: proper selection of the gateway  when the maxload is 0

- reported and patch by Carlos Cruz Luengo, GH #800

(cherry picked from commit a0521f714a29fe205f83cd176f961344c8d9c79d)

---

Modified: modules/dispatcher/dispatch.c

---

Diff:  https://github.com/kamailio/kamailio/commit/94ef3dcaa99680cb12897db27d81d39e0e1e2d5e.diff
Patch: https://github.com/kamailio/kamailio/commit/94ef3dcaa99680cb12897db27d81d39e0e1e2d5e.patch

---

diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index c1a831b..d4c6ab8 100644
--- a/modules/dispatcher/dispatch.c
+++ b/modules/dispatcher/dispatch.c
@@ -1449,7 +1449,8 @@ int ds_get_leastloaded(ds_set_t *dset)
 	for(j=0; j<dset->nr; j++)
 	{
 		if(!ds_skip_dst(dset->dlist[j].flags)
-				&& dset->dlist[j].dload<dset->dlist[j].attrs.maxload)
+				&& (dset->dlist[j].attrs.maxload == 0
+					|| dset->dlist[j].dload<dset->dlist[j].attrs.maxload))
 		{
 			if(dset->dlist[j].dload<t)
 			{




More information about the sr-dev mailing list