Module: kamailio Branch: master Commit: 5b23ce265b43adda75731a90fdf1a3a47daa3a51 URL: https://github.com/kamailio/kamailio/commit/5b23ce265b43adda75731a90fdf1a3a47daa3a51
Author: Alex Hermann <[email protected]> Committer: Henning Westerholt <[email protected]> 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/5b23ce265b43adda75731a90fdf1a3a47daa3a51.diff Patch: https://github.com/kamailio/kamailio/commit/5b23ce265b43adda75731a90fdf1a3a47daa3a51.patch --- 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) { _______________________________________________ Kamailio (SER) - Development Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
