[sr-dev] git:master:a0521f71: dispatcher: proper selection of the gateway when the maxload is 0

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


Module: kamailio
Branch: master
Commit: a0521f714a29fe205f83cd176f961344c8d9c79d
URL: https://github.com/kamailio/kamailio/commit/a0521f714a29fe205f83cd176f961344c8d9c79d

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

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

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

---

Modified: modules/dispatcher/dispatch.c

---

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

---

diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index f257475..be268b7 100644
--- a/modules/dispatcher/dispatch.c
+++ b/modules/dispatcher/dispatch.c
@@ -1406,7 +1406,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