Skip to content

Commit

Permalink
Fixed mixing of return code.
Browse files Browse the repository at this point in the history
Do not re-use the "ret" return code variable when comes to testing the running of the script route (per rule) - it may stay stay to 0 and stop the whole script execution.

(cherry picked from commit 9812097)
  • Loading branch information
bogdan-iancu committed Apr 5, 2017
1 parent da68b9b commit f0992d5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/drouting/drouting.c
Expand Up @@ -1529,7 +1529,7 @@ static int do_routing(struct sip_msg* msg, dr_group_t *drg, int flags,
str ruri;
str next_carrier_attrs = {NULL, 0};
str next_gw_attrs = {NULL, 0};
int ret;
int ret, fret;
char tmp;
char *ruri_buf;

Expand Down Expand Up @@ -1698,12 +1698,11 @@ static int do_routing(struct sip_msg* msg, dr_group_t *drg, int flags,
}

if (rt_info->route_idx>0 && rt_info->route_idx<RT_NO) {
ret = run_top_route( rlist[rt_info->route_idx].a, msg );
if (ret&ACT_FL_DROP) {
fret = run_top_route( rlist[rt_info->route_idx].a, msg );
if (fret&ACT_FL_DROP) {
/* drop the action */
LM_DBG("script route %s drops routing "
"by %d\n", rlist[rt_info->route_idx].name, ret);
ret = -1;
"by %d\n", rlist[rt_info->route_idx].name, fret);
goto error2;
}
}
Expand Down

0 comments on commit f0992d5

Please sign in to comment.