Module: kamailio
Branch: 4.4
Commit: 94ef3dcaa99680cb12897db27d81d39e0e1e2d5e
URL:
https://github.com/kamailio/kamailio/commit/94ef3dcaa99680cb12897db27d81d39…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/94ef3dcaa99680cb12897db27d81d39…
Patch:
https://github.com/kamailio/kamailio/commit/94ef3dcaa99680cb12897db27d81d39…
---
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)
{