[sr-dev] git:master: modules/carrieroute: fixed a bug in carrieroute
Marius Ovidiu Bucur
marius at marius-bucur.ro
Wed May 11 12:47:35 CEST 2011
Module: sip-router
Branch: master
Commit: f5f934fa55a7938cb85b85e7661d5a9dcc5629c6
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f5f934fa55a7938cb85b85e7661d5a9dcc5629c6
Author: Marius Bucur <marius.bucur at 1and1.ro>
Committer: Marius Bucur <marius.bucur at 1and1.ro>
Date: Wed May 11 13:43:08 2011 +0300
modules/carrieroute: fixed a bug in carrieroute
the bug caused carrieroute to crash when an invalid SIP message is received (e.g. with no callid)
---
modules/carrierroute/cr_func.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/carrierroute/cr_func.c b/modules/carrierroute/cr_func.c
index 714a130..1006228 100644
--- a/modules/carrierroute/cr_func.c
+++ b/modules/carrierroute/cr_func.c
@@ -437,7 +437,7 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
}
break;
case alg_crc32_nofallback:
- if ((prob = (hash_func(msg, hash_source, rf->max_targets) + 1)) < 0) {
+ if ((prob = (hash_func(msg, hash_source, rf->max_targets))) < 0) {
LM_ERR("could not hash message with CRC32");
return -1;
}
@@ -445,7 +445,7 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
* this function just tries only a backup rule and otherwise
* returns -1. This way we get an error
*/
- if ((rr = get_rule_by_hash(rf, prob)) == NULL) {
+ if ((rr = get_rule_by_hash(rf, prob + 1)) == NULL) {
LM_CRIT("no route found\n");
return -1;
}
More information about the sr-dev
mailing list