[sr-dev] git:master: cr: fix bug in recently introduced nofallback function, also remove wrong check

Henning Westerholt henning.westerholt at 1und1.de
Wed Oct 21 14:17:10 CEST 2009


Module: sip-router
Branch: master
Commit: dfdc81a55ec2951f9c6559e792f81fbba08b5c51
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=dfdc81a55ec2951f9c6559e792f81fbba08b5c51

Author: Henning Westerholt <henning.westerholt at 1und1.de>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Wed Oct 21 14:16:38 2009 +0200

cr: fix bug in recently introduced nofallback function, also remove wrong check

---

 modules/carrierroute/cr_func.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/modules/carrierroute/cr_func.c b/modules/carrierroute/cr_func.c
index 1dd15c8..c1fcf21 100644
--- a/modules/carrierroute/cr_func.c
+++ b/modules/carrierroute/cr_func.c
@@ -436,11 +436,7 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
 			}
 			break;
 		case alg_crc32_nofallback:
-			if(rf->max_targets == 0) {
-				LM_ERR("invalid dice_max value\n");
-				return -1;
-			}
-			if ((prob = (hash_func(msg, hash_source, rf->dice_max) + 1)) < 0) {
+			if ((prob = (hash_func(msg, hash_source, rf->max_targets) + 1)) < 0) {
 				LM_ERR("could not hash message with CRC32");
 				return -1;
 			}




More information about the sr-dev mailing list