瀏覽代碼

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

Henning Westerholt 16 年之前
父節點
當前提交
dfdc81a55e
共有 1 個文件被更改,包括 1 次插入5 次删除
  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;
 		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;
 			}