Browse Source

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

Henning Westerholt 16 years ago
parent
commit
dfdc81a55e
1 changed files with 1 additions and 5 deletions
  1. 1 5
      modules/carrierroute/cr_func.c

+ 1 - 5
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;
 			break;
 		case alg_crc32_nofallback:
 		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");
 				LM_ERR("could not hash message with CRC32");
 				return -1;
 				return -1;
 			}
 			}