Skip to content

Commit

Permalink
Fix fallback after another fallback.
Browse files Browse the repository at this point in the history
Avoid decrementing the prefix len if already 0.

(cherry picked from commit 54438e4)
  • Loading branch information
bogdan-iancu committed Jan 5, 2017
1 parent f949a9c commit e0b4466
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/drouting/drouting.c
Expand Up @@ -2970,7 +2970,7 @@ static int do_routing(struct sip_msg* msg, dr_part_group_t * part_group,
void *data;
/* all rules under current prefix used -> reduce the prefix */
data = (void*)&avp_prefix->data;
((str*)data)->len = prefix_len-1;
((str*)data)->len = prefix_len?prefix_len-1:0;
}
LM_DBG("updating to %d, prefix %.*s \n",rule_idx,
prefix_len-(rule_idx?1:0),username.s);
Expand Down

0 comments on commit e0b4466

Please sign in to comment.