Browse code

cr: bug fix in new introduced function, cr_nofallback_routing

Henning Westerholt authored on 08/09/2009 16:03:50
Showing 1 changed files
... ...
@@ -425,11 +425,11 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
425 425
 			}
426 426
 			break;
427 427
 		case alg_crc32_nofallback:
428
-			if(rf->dice_max == 0) {
428
+			if(rf->max_targets == 0) {
429 429
 				LM_ERR("invalid dice_max value\n");
430 430
 				return -1;
431 431
 			}
432
-			if ((prob = hash_func(msg, hash_source, rf->dice_max)) < 0) {
432
+			if ((prob = (hash_func(msg, hash_source, rf->dice_max) + 1)) < 0) {
433 433
 				LM_ERR("could not hash message with CRC32");
434 434
 				return -1;
435 435
 			}