Browse code

Modules:carrierroute: Fixed a bug in carrirroute module that might cause a crash if the routing prob was larger than the number of available routes.

The problem was caused by a missing else
(cherry picked from commit 16bdf9ea21b310d49d5d99dee43cfd57990eb1bb)

Marius Zbihlei authored on 04/05/2010 10:10:03 • Andrei Pelinescu-Onciul committed on 28/05/2010 18:47:17
Showing 1 changed files
... ...
@@ -257,7 +257,7 @@ static struct route_rule * get_rule_by_hash(const struct route_flags * rf,
257 257
 		LM_WARN("too large desired hash, taking highest\n");
258 258
 		act_hash = rf->rules[rf->rule_num - 1];
259 259
 	}
260
-	act_hash = rf->rules[prob - 1];
260
+	else act_hash = rf->rules[prob - 1];
261 261
 
262 262
 	if (!act_hash->status) {
263 263
 		if (act_hash->backup && act_hash->backup->rr) {