Skip to content

Commit

Permalink
Fix crash on fallback from a prefix-less rule.
Browse files Browse the repository at this point in the history
If a prefix-less (empty prefix) rule matched, do not attempt to do fallback by reducing the len of the prefix.

(cherry picked from commit 6e7495a)
  • Loading branch information
bogdan-iancu committed Jan 5, 2017
1 parent df12a17 commit d41828f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/drouting/drouting.c
Expand Up @@ -3024,7 +3024,9 @@ static int do_routing(struct sip_msg* msg, dr_part_group_t * part_group,
/* we are done reading -> unref the data */
lock_stop_read( current_partition->ref_lock );

if ( flags & DR_PARAM_RULE_FALLBACK ) {
/* prepare data for fallback only if instructed so and if there is
* place for fallback (more rules or shorter prefix are available) */
if ( flags & DR_PARAM_RULE_FALLBACK && (prefix_len!=0 || rule_idx!=0) ) {
if ( !(flags & DR_PARAM_INTERNAL_TRIGGERED) ) {
/* first time ? we need to save some date, to be able to
do the rule fallback later in "next_gw" */
Expand Down

0 comments on commit d41828f

Please sign in to comment.