Module: kamailio
Branch: 5.1
Commit: c931f2859a0762f48d41f1c2dbaf522d33c72cba
URL: 
https://github.com/kamailio/kamailio/commit/c931f2859a0762f48d41f1c2dbaf522d33c72cba

Author: Alex Hermann <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2019-02-05T21:25:17+01:00

dispatcher: Don't take modulus of hash twice

(cherry picked from commit 5b23ce265b43adda75731a90fdf1a3a47daa3a51)

---

Modified: src/modules/dispatcher/dispatch.c

---

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

---

diff --git a/src/modules/dispatcher/dispatch.c 
b/src/modules/dispatcher/dispatch.c
index bf99b7836e..e40d02e974 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -1878,7 +1878,7 @@ int ds_select_dst_limit(
                        }
                        break;
                case DS_ALG_RANDOM: /* 6 - random selection */
-                       hash = kam_rand() % idx->nr;
+                       hash = kam_rand();
                        break;
                case DS_ALG_HASHPV: /* 7 - hash on PV value */
                        if(ds_hash_pvar(msg, &hash) != 0) {


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to