Module: kamailio
Branch: master
Commit: 5b23ce265b43adda75731a90fdf1a3a47daa3a51
URL:
https://github.com/kamailio/kamailio/commit/5b23ce265b43adda75731a90fdf1a3a…
Author: Alex Hermann <alex(a)hexla.nl>
Committer: Henning Westerholt <henningw(a)users.noreply.github.com>
Date: 2019-02-05T21:11:03+01:00
dispatcher: Don't take modulus of hash twice
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5b23ce265b43adda75731a90fdf1a3a…
Patch:
https://github.com/kamailio/kamailio/commit/5b23ce265b43adda75731a90fdf1a3a…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index 9255e9eae6..2a4fd853b2 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -2089,7 +2089,7 @@ int ds_manage_routes(sip_msg_t *msg, ds_select_state_t *rstate)
}
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) {